Skip to content

Commit a154075

Browse files
committed
fix(Stack): Any values not recognizing floats
1 parent 377571c commit a154075

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/scripting/stack.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ std::any DeserializeData(EValue ref, EContext* state)
168168
return ref.cast<bool>();
169169
else if (ref.isNull())
170170
return nullptr;
171-
else if (ref.isNumber())
172-
return ref.cast<int64_t>();
171+
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>();
174+
}
173175
else if (ref.isString())
174176
return ref.cast<std::string>();
175177
else if (ref.isInstance<ClassData*>())

0 commit comments

Comments
 (0)