From 0ccc70c843061ef0a38593863fe2a987e33e10d1 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Mon, 2 Nov 2020 23:53:52 +0300 Subject: [PATCH 1/2] embarassing --- 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 f9935e21..40fb1ded 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -12125,14 +12125,14 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command) { int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL); CollectParameters(&m_nIp, 1); - UpdateCompareFlag(*ptr = ScriptParams[0]); + UpdateCompareFlag(*ptr == ScriptParams[0]); return 0; } case COMMAND_IS_INT_LVAR_EQUAL_TO_CONSTANT: { int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL); CollectParameters(&m_nIp, 1); - UpdateCompareFlag(*ptr = ScriptParams[0]); + UpdateCompareFlag(*ptr == ScriptParams[0]); return 0; } case COMMAND_GET_DEAD_CHAR_PICKUP_COORDS: From e473123a6aa3769b7aeef54526561c2f1ab32cc1 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Tue, 3 Nov 2020 00:07:25 +0300 Subject: [PATCH 2/2] fixes --- src/control/Script.cpp | 2 +- src/peds/PedAttractor.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 40fb1ded..6aa314f2 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -12280,7 +12280,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) case COMMAND_IS_CONSTANT_GREATER_OR_EQUAL_TO_INT_VAR: { CollectParameters(&m_nIp, 1); - int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_LOCAL); + int32* ptr = GetPointerToScriptVariable(&m_nIp, VAR_GLOBAL); UpdateCompareFlag(ScriptParams[0] >= *ptr); return 0; } diff --git a/src/peds/PedAttractor.cpp b/src/peds/PedAttractor.cpp index 45bed947..05e72ed3 100644 --- a/src/peds/PedAttractor.cpp +++ b/src/peds/PedAttractor.cpp @@ -136,7 +136,7 @@ void CPedAttractorManager::RemoveIceCreamVanEffects(C2dEffect* pEffect) return; for (std::vector::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend();) { if (assoc->GetVehicle() != pVehicle) { - assoc++; + ++assoc; continue; } uint32 total = 0; @@ -145,7 +145,7 @@ void CPedAttractorManager::RemoveIceCreamVanEffects(C2dEffect* pEffect) total++; } if (total > 0) - assoc++; + ++assoc; else assoc = vVehicleToEffect.erase(assoc); }