Fix complement operator being incorrect with float values

This commit is contained in:
smallmodel committed 2025-06-08 22:42:47 +02:00
1 parent dad49e46ed
commit c350b7e9c4
1 file changed
+1 -4
+1 -4
View File
@@ -2263,10 +2263,7 @@ void ScriptVariable::complement(void)
if (type == VARIABLE_INTEGER) {
m_data.intValue = ~m_data.intValue;
} else {
float value = floatValue();
int i = ~*(int *)&value; // ley0k: evil floating point hack
setFloatValue(*(float *)&i);
setIntValue(~intValue());
}
}