mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-18 08:00:22 +02:00
Fix complement operator being incorrect with float values
This commit is contained in:
1 file changed
+1
-4
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user