From a01a53e6972c08d8170c15c31d8d0b0172f1cc64 Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Fri, 25 Dec 2020 16:23:08 +0100 Subject: [PATCH] script endian issue --- src/control/Script.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 0a9dee01..76528903 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -2957,9 +2957,9 @@ int8 CRunningScript::ProcessCommands0To99(int32 command) case COMMAND_SUB_INT_VAR_FROM_INT_VAR: nScriptVar1 = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL); #ifndef BIGENDIAN - *fScriptVar1 += *(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL); + *nScriptVar1 -= GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL); #else - *fScriptVar1 = FLOATSWAP32(FLOATSWAP32(*fScriptVar1) + FLOATSWAP32(*(float*)GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL))); + *nScriptVar1 = BSWAP32(BSWAP32(*nScriptVar1) - BSWAP32(*GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL))); #endif return 0; case COMMAND_SUB_INT_LVAR_FROM_INT_LVAR: