aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorThanasis Antoniou2019-07-23 14:51:27 +0300
committerThanasis Antoniou2019-07-23 14:51:27 +0300
commitb7d1099658c8324533cfa4b225340ba539d01b61 (patch)
tree7b27de6a9c1ce44a5aeed4670b8b26cf6006a696 /engines
parent1450a240a00a6a90f9c0f2cb837266a9d61d4281 (diff)
downloadscummvm-rg350-b7d1099658c8324533cfa4b225340ba539d01b61.tar.gz
scummvm-rg350-b7d1099658c8324533cfa4b225340ba539d01b61.tar.bz2
scummvm-rg350-b7d1099658c8324533cfa4b225340ba539d01b61.zip
BLADERUNNER: Fix minor code quality issues (codacy)
Diffstat (limited to 'engines')
-rw-r--r--engines/bladerunner/debugger.cpp8
-rw-r--r--engines/bladerunner/script/scene/ps06.cpp11
-rw-r--r--engines/bladerunner/script/scene/ps10.cpp4
-rw-r--r--engines/bladerunner/script/scene/rc01.cpp5
-rw-r--r--engines/bladerunner/script/scene/tb06.cpp4
5 files changed, 15 insertions, 17 deletions
diff --git a/engines/bladerunner/debugger.cpp b/engines/bladerunner/debugger.cpp
index 05bc47dc41..7ecd43e651 100644
--- a/engines/bladerunner/debugger.cpp
+++ b/engines/bladerunner/debugger.cpp
@@ -220,12 +220,11 @@ bool Debugger::cmdDraw(int argc, const char **argv) {
} else {
Common::String arg = argv[1];
- int specificObjectId = -1;
DebuggerDrawnObject dbgDrawnObj;
dbgDrawnObj.type = debuggerObjTypeUndefined;
if (argc == 3) {
- specificObjectId = atoi(argv[2]);
+ int specificObjectId = atoi(argv[2]);
dbgDrawnObj.objId = specificObjectId;
dbgDrawnObj.sceneId = _vm->_scene->getSceneId();
dbgDrawnObj.setId = _vm->_scene->getSetId();
@@ -1053,8 +1052,6 @@ const struct OverlayAndScenesVQAsList {
*/
bool Debugger::cmdOverlay(int argc, const char **argv) {
bool invalidSyntax = false;
- bool modeMixOverlaysAvailableFlg = false;
- int chapterIdOverlaysAvailableInt = -1;
if (_vm->_kia->isOpen()
|| _vm->_esper->isOpen()
@@ -1070,6 +1067,9 @@ bool Debugger::cmdOverlay(int argc, const char **argv) {
if (argc != 1 && argc != 2 && argc != 3 && argc != 5) {
invalidSyntax = true;
} else {
+ bool modeMixOverlaysAvailableFlg = false;
+ int chapterIdOverlaysAvailableInt = -1;
+
if (_vm->_chapters->hasOpenResources()) {
chapterIdOverlaysAvailableInt = MIN(_vm->_chapters->currentResourceId(), 3);
}
diff --git a/engines/bladerunner/script/scene/ps06.cpp b/engines/bladerunner/script/scene/ps06.cpp
index 10797e350f..bf9a82cace 100644
--- a/engines/bladerunner/script/scene/ps06.cpp
+++ b/engines/bladerunner/script/scene/ps06.cpp
@@ -85,17 +85,16 @@ bool SceneScriptPS06::ClickedOn3DObject(const char *objectName, bool a2) {
Actor_Clues_Transfer_New_From_Mainframe(kActorMcCoy);
return true;
} else {
- bool tranferedClues = false;
- tranferedClues = Actor_Clues_Transfer_New_To_Mainframe(kActorMcCoy);
- if (_vm->_cutContent && !tranferedClues) {
+ bool transferedClues = Actor_Clues_Transfer_New_To_Mainframe(kActorMcCoy);
+ if (_vm->_cutContent && !transferedClues) {
Actor_Says(kActorAnsweringMachine, 370, kAnimationModeTalk); // no clues transfered
} else {
Ambient_Sounds_Play_Sound(kSfxDATALOAD, 50, 0, 0, 99);
Delay(2000);
}
Actor_Says(kActorAnsweringMachine, 340, kAnimationModeTalk); // downloading clues
- tranferedClues = Actor_Clues_Transfer_New_From_Mainframe(kActorMcCoy);
- if (_vm->_cutContent && !tranferedClues) {
+ transferedClues = Actor_Clues_Transfer_New_From_Mainframe(kActorMcCoy);
+ if (_vm->_cutContent && !transferedClues) {
Actor_Says(kActorAnsweringMachine, 370, kAnimationModeTalk); // no clues transfered
} else {
Ambient_Sounds_Play_Sound(kSfxDATALOAD, 50, 0, 0, 99);
@@ -103,7 +102,7 @@ bool SceneScriptPS06::ClickedOn3DObject(const char *objectName, bool a2) {
}
Ambient_Sounds_Play_Sound(kSfxBEEPNEAT, 80, 0, 0, 99);
Actor_Says(kActorAnsweringMachine, 350, kAnimationModeTalk); // db transfer complete
- if (_vm->_cutContent && tranferedClues) {
+ if (_vm->_cutContent && transferedClues) {
Actor_Says(kActorAnsweringMachine, 360, kAnimationModeTalk); // new clues added
}
return true;
diff --git a/engines/bladerunner/script/scene/ps10.cpp b/engines/bladerunner/script/scene/ps10.cpp
index b2b4ba885a..01e28a5903 100644
--- a/engines/bladerunner/script/scene/ps10.cpp
+++ b/engines/bladerunner/script/scene/ps10.cpp
@@ -446,11 +446,11 @@ void SceneScriptPS10::SceneLoaded() {
Unobstacle_Object("E.SM.WIRE01", true);
if (!Query_System_Currently_Loading_Game()) {
- bool targetStateMZ = true;
#if BLADERUNNER_ORIGINAL_BUGS
+ bool targetStateMZ = true;
#else
// every maze target begins as NON-targetable
- targetStateMZ = false;
+ bool targetStateMZ = false;
#endif // BLADERUNNER_ORIGINAL_BUGS
Item_Add_To_World(kItemPS10Target1, kModelAnimationMaleTargetWithGunActive, kSetPS10_PS11_PS12_PS13, -240.0f, -80.74f, 145.0f, 989, 72, 36, targetStateMZ, false, false, true);
Item_Add_To_World(kItemPS10Target2, kModelAnimationMaleTargetWithGunActive, kSetPS10_PS11_PS12_PS13, -240.0f, -8.74f, 145.0f, 740, 72, 36, targetStateMZ, false, false, true);
diff --git a/engines/bladerunner/script/scene/rc01.cpp b/engines/bladerunner/script/scene/rc01.cpp
index 2ed5c78488..4c0f0b7f87 100644
--- a/engines/bladerunner/script/scene/rc01.cpp
+++ b/engines/bladerunner/script/scene/rc01.cpp
@@ -439,13 +439,12 @@ void SceneScriptRC01::walkToCenter() {
bool SceneScriptRC01::ClickedOnExit(int exitId) {
if (exitId == kRC01ExitRC02) {
- bool walkToRC02ExitResult = true;
#if BLADERUNNER_ORIGINAL_BUGS
- walkToRC02ExitResult = Loop_Actor_Walk_To_XYZ(kActorMcCoy, -174.77f, 5.55f, 25.95f, 12, true, false, false);
+ bool walkToRC02ExitResult = Loop_Actor_Walk_To_XYZ(kActorMcCoy, -174.77f, 5.55f, 25.95f, 12, true, false, false);
#else
// fixes clipping into the closed door of the shop when McCoy says locked or goes in
// This was reproducible mainly by entering from Bullet Bob's (RC03) and clicking on the door immediately
- walkToRC02ExitResult = Loop_Actor_Walk_To_XYZ(kActorMcCoy, -170.38f, 5.55f, 35.00f, 12, true, false, false);
+ bool walkToRC02ExitResult = Loop_Actor_Walk_To_XYZ(kActorMcCoy, -170.38f, 5.55f, 35.00f, 12, true, false, false);
#endif // BLADERUNNER_ORIGINAL_BUGS
if (!walkToRC02ExitResult) {
if (Game_Flag_Query(kFlagRC02RunciterTalkWithGun)) {
diff --git a/engines/bladerunner/script/scene/tb06.cpp b/engines/bladerunner/script/scene/tb06.cpp
index 68f5bbd39f..a2177bfae4 100644
--- a/engines/bladerunner/script/scene/tb06.cpp
+++ b/engines/bladerunner/script/scene/tb06.cpp
@@ -178,14 +178,14 @@ void SceneScriptTB06::PlayerWalkedIn() {
Actor_Says(kActorMcCoy, 5290, kAnimationModeTalk);
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -10.0f, 149.0f, -631.0f, 0, false, false, false);
- bool talkWithPhotographer = false;
#if BLADERUNNER_ORIGINAL_BUGS
- talkWithPhotographer = true;
+ bool talkWithPhotographer = true;
#else
// It's possible for McCoy to go to AR01 (so the kActorPhotographer will go away from TB06)
// without ever going into this scene (TB06)
// so later on in the Act, if McCoy visits this scene the Photographer would be gone
// but the dialogue would play as if he was there. This fixes that bug.
+ bool talkWithPhotographer = false;
if (Actor_Query_Is_In_Current_Set(kActorPhotographer)) {
talkWithPhotographer = true;
}