From 193fb2a381af6ec86e2e38c854a4a6b017aa2645 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Sat, 16 Jan 2021 13:24:22 +0300 Subject: fix --- src/control/Script6.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/control') diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp index 76780941..b82c961d 100644 --- a/src/control/Script6.cpp +++ b/src/control/Script6.cpp @@ -77,6 +77,7 @@ bool CRunningScript::ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool f default: return miami && (mi >= MI_VICE1 && mi <= MI_VICE8); } + return false; } int8 CRunningScript::ProcessCommands1000To1099(int32 command) -- cgit v1.2.3 From 7ea77d8da41c05ea30716c1663f2b1f852574f1f Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 16 Jan 2021 13:32:41 +0300 Subject: more fix --- src/control/Script.h | 3 +-- src/control/Script6.cpp | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 16 deletions(-) (limited to 'src/control') diff --git a/src/control/Script.h b/src/control/Script.h index aafc681c..ae984c59 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -570,12 +570,11 @@ public: float LimitAngleOnCircle(float angle) { return angle < 0.0f ? angle + 360.0f : angle; } + bool ThisIsAValidRandomCop(uint32 mi, int cop, int swat, int fbi, int army, int miami); bool ThisIsAValidRandomPed(uint32 pedtype, int civ, int gang, int criminal); bool CheckDamagedWeaponType(int32 actual, int32 type); - static bool ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami); - }; #ifdef USE_DEBUG_SCRIPT_LOADER diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp index b82c961d..c9828758 100644 --- a/src/control/Script6.cpp +++ b/src/control/Script6.cpp @@ -42,6 +42,20 @@ extern const char* scriptfile; #endif +bool CRunningScript::ThisIsAValidRandomCop(uint32 mi, int cop, int swat, int fbi, int army, int miami) +{ + switch (mi) + { + case MI_COP: if (cop) return true; break; + case MI_SWAT: if (swat) return true; break; + case MI_FBI: if (fbi) return true; break; + case MI_ARMY: if (army) return true; break; + default: + return miami && (mi >= MI_VICE1 && mi <= MI_VICE8); + } + return false; +} + bool CRunningScript::ThisIsAValidRandomPed(uint32 pedtype, int civ, int gang, int criminal) { switch (pedtype) { @@ -66,20 +80,6 @@ bool CRunningScript::ThisIsAValidRandomPed(uint32 pedtype, int civ, int gang, in } } -bool CRunningScript::ThisIsAValidRandomCop(int32 mi, bool cop, bool swat, bool fbi, bool army, bool miami) -{ - switch (mi) - { - case MI_COP: if (cop) return true; - case MI_SWAT: if (swat) return true; - case MI_FBI: if (fbi) return true; - case MI_ARMY: if (army) return true; - default: - return miami && (mi >= MI_VICE1 && mi <= MI_VICE8); - } - return false; -} - int8 CRunningScript::ProcessCommands1000To1099(int32 command) { switch (command) { -- cgit v1.2.3 From 32ab01cd32adbe7a2ab6fb1cad8501547ff123ee Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 16 Jan 2021 13:42:04 +0300 Subject: consistency fix --- src/control/Script6.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/control') diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp index c9828758..4d7121f2 100644 --- a/src/control/Script6.cpp +++ b/src/control/Script6.cpp @@ -50,8 +50,7 @@ bool CRunningScript::ThisIsAValidRandomCop(uint32 mi, int cop, int swat, int fbi case MI_SWAT: if (swat) return true; break; case MI_FBI: if (fbi) return true; break; case MI_ARMY: if (army) return true; break; - default: - return miami && (mi >= MI_VICE1 && mi <= MI_VICE8); + default: if (mi >= MI_VICE1 && mi <= MI_VICE8 && miami) return true; break; } return false; } -- cgit v1.2.3