Skip to content

Commit 24f6393

Browse files
authored
fix(AnyCast): Float value
1 parent 8d484c9 commit 24f6393

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/scripting/stack.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ std::any DeserializeData(EValue ref, EContext* state)
169169
else if (ref.isNull())
170170
return nullptr;
171171
else if (ref.isNumber()) {
172-
if (ref.cast<float>() == (float)(ref.cast<int64_t>())) return ref.cast<float>();
173-
else return ref.cast<int64_t>();
172+
if (ref.cast<float>() == (float)(ref.cast<int64_t>())) return ref.cast<int64_t>();
173+
else return ref.cast<float>();
174174
}
175175
else if (ref.isString())
176176
return ref.cast<std::string>();
@@ -210,4 +210,4 @@ std::any DeserializeData(EValue ref, EContext* state)
210210
}
211211
else
212212
return nullptr;
213-
}
213+
}

0 commit comments

Comments
 (0)