diff options
author | Peter Kohaut | 2018-02-12 20:53:13 +0100 |
---|---|---|
committer | Peter Kohaut | 2018-02-12 20:57:26 +0100 |
commit | 1d9a248abe37a5e8230571d2b35cd96773be7f1e (patch) | |
tree | 08fb84f18dc8b3d5dbcc12555e7804b0cfb34e0b /engines/bladerunner/script | |
parent | 7f50c5040144627cf00ccd91831946c356c45860 (diff) | |
download | scummvm-rg350-1d9a248abe37a5e8230571d2b35cd96773be7f1e.tar.gz scummvm-rg350-1d9a248abe37a5e8230571d2b35cd96773be7f1e.tar.bz2 scummvm-rg350-1d9a248abe37a5e8230571d2b35cd96773be7f1e.zip |
BLADERUNNER: Fixed more Coverity issues
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r-- | engines/bladerunner/script/scene/hf01.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/kp05.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ma02.cpp | 6 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/nr04.cpp | 2 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ps05.cpp | 7 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ug05.cpp | 2 |
6 files changed, 6 insertions, 15 deletions
diff --git a/engines/bladerunner/script/scene/hf01.cpp b/engines/bladerunner/script/scene/hf01.cpp index 67f538f12e..6944854ee1 100644 --- a/engines/bladerunner/script/scene/hf01.cpp +++ b/engines/bladerunner/script/scene/hf01.cpp @@ -125,7 +125,7 @@ bool SceneScriptHF01::ClickedOnActor(int actorId) { } return false; } - if (actorId == v1) { + if (v1 != -1 && actorId == v1) { if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, actorId, 28, 1, false)) { if (Actor_Query_Goal_Number(v1) == 599) { Actor_Says(kActorMcCoy, 8630, 13); diff --git a/engines/bladerunner/script/scene/kp05.cpp b/engines/bladerunner/script/scene/kp05.cpp index 6ac4d1f1e0..9b080aceb0 100644 --- a/engines/bladerunner/script/scene/kp05.cpp +++ b/engines/bladerunner/script/scene/kp05.cpp @@ -132,7 +132,7 @@ void SceneScriptKP05::PlayerWalkedIn() { Game_Flag_Reset(574); } else { Loop_Actor_Walk_To_XYZ(kActorMcCoy, -846.0f, 0.0f, 972.0f, 0, 0, false, 0); - Game_Flag_Query(419); + Game_Flag_Query(419); // bug in game? } if (Actor_Query_Goal_Number(kActorMaggie) == 411) { Actor_Set_Goal_Number(kActorMaggie, 412); diff --git a/engines/bladerunner/script/scene/ma02.cpp b/engines/bladerunner/script/scene/ma02.cpp index 98887ed67e..bd4407ada0 100644 --- a/engines/bladerunner/script/scene/ma02.cpp +++ b/engines/bladerunner/script/scene/ma02.cpp @@ -240,11 +240,7 @@ void SceneScriptMA02::sub_402044() { if (Game_Flag_Query(171) && Game_Flag_Query(170)) { arr[i++] = 4; } - if (i == 0) { - Global_Variable_Set(52, -1); - } else { - Global_Variable_Set(52, arr[Random_Query(0, i - 1)]); - } + Global_Variable_Set(52, arr[Random_Query(0, i - 1)]); } } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/scene/nr04.cpp b/engines/bladerunner/script/scene/nr04.cpp index 2ef114a3e6..18583f0d75 100644 --- a/engines/bladerunner/script/scene/nr04.cpp +++ b/engines/bladerunner/script/scene/nr04.cpp @@ -320,7 +320,7 @@ void SceneScriptNR04::sub_402860(int frame) { 0.0f, 0.0f, 1.0f, 0.5f, 0.0f, 0.8f}; - float v3 = (frame - 60) / 10; + float v3 = (frame - 60) * 0.1f; float v4 = (frame % 10) * 0.1f; float coef = 1.0f; if (frame > 100) { diff --git a/engines/bladerunner/script/scene/ps05.cpp b/engines/bladerunner/script/scene/ps05.cpp index a0bb9a7135..e2aa7e8c4b 100644 --- a/engines/bladerunner/script/scene/ps05.cpp +++ b/engines/bladerunner/script/scene/ps05.cpp @@ -177,12 +177,7 @@ void SceneScriptPS05::sub_401B34() { if (Game_Flag_Query(171) && Game_Flag_Query(170)) { arr[i++] = 4; } - if (i == 0) { - Global_Variable_Set(52, -1); - } - else { - Global_Variable_Set(52, arr[Random_Query(0, i - 1)]); - } + Global_Variable_Set(52, arr[Random_Query(0, i - 1)]); } void SceneScriptPS05::sub_401C30() { diff --git a/engines/bladerunner/script/scene/ug05.cpp b/engines/bladerunner/script/scene/ug05.cpp index e2f83c6fc3..e02b6ed1a7 100644 --- a/engines/bladerunner/script/scene/ug05.cpp +++ b/engines/bladerunner/script/scene/ug05.cpp @@ -208,7 +208,7 @@ void SceneScriptUG05::PlayerWalkedIn() { } } if (Game_Flag_Query(663)) { - Game_Flag_Query(368); + Game_Flag_Query(368); // bug in game? } Game_Flag_Reset(360); } |