aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script
diff options
context:
space:
mode:
authorD G Turner2019-10-04 02:13:46 +0100
committerD G Turner2019-10-04 02:13:46 +0100
commit40337b67e23e21251a22138eab865f7ca5fc924f (patch)
tree4dd3763b4ae8c55ebc2e05b06daf3fa0af733d12 /engines/bladerunner/script
parent522c5b654858ea4b1a7341060ecc8e259c7a5331 (diff)
downloadscummvm-rg350-40337b67e23e21251a22138eab865f7ca5fc924f.tar.gz
scummvm-rg350-40337b67e23e21251a22138eab865f7ca5fc924f.tar.bz2
scummvm-rg350-40337b67e23e21251a22138eab865f7ca5fc924f.zip
BLADERUNNER: Add More Missing Switch Default Cases in ESPER Script
This also removes most of the return calls from one of these switch statements using a return variable instead to reduce complexity.
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r--engines/bladerunner/script/esper_script.cpp45
1 files changed, 30 insertions, 15 deletions
diff --git a/engines/bladerunner/script/esper_script.cpp b/engines/bladerunner/script/esper_script.cpp
index 47d17aa592..9c48c1c3e0 100644
--- a/engines/bladerunner/script/esper_script.cpp
+++ b/engines/bladerunner/script/esper_script.cpp
@@ -176,11 +176,13 @@ void ESPERScript::SCRIPT_ESPER_DLL_Photo_Selected(int photo) {
break;
default:
- return;
+ break;
}
}
bool ESPERScript::SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region) {
+ bool retValue = false;
+
switch (photo) {
case 0:
if (region == 0) {
@@ -205,7 +207,8 @@ bool ESPERScript::SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region
Actor_Clue_Acquire(kActorMcCoy, kClueSushiMenu, true, -1);
}
}
- return true;
+ retValue = true;
+ break;
case 1:
if (region == 3) {
@@ -237,7 +240,8 @@ bool ESPERScript::SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region
Actor_Clue_Acquire(kActorMcCoy, kClueCarColorAndMake, true, -1);
}
}
- return true;
+ retValue = true;
+ break;
case 2:
if (region == 8) {
@@ -255,7 +259,8 @@ bool ESPERScript::SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region
Actor_Clue_Acquire(kActorMcCoy, kClueScorpionbox, true, -1);
}
}
- return true;
+ retValue = true;
+ break;
case 3:
if (region == 9) {
@@ -265,17 +270,17 @@ bool ESPERScript::SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region
Sound_Play(kSfxBR034_1A, 50, 0, 0, 50);
Actor_Clue_Acquire(kActorMcCoy, kClueClovisflowers, true, -1);
}
- return true;
- } if (region == 10) {
+ retValue = true;
+ } else if (region == 10) {
Actor_Voice_Over(4040, kActorVoiceOver);
if (!Actor_Clue_Query(kActorMcCoy, kClueLucyWithDektora)) {
Actor_Says(kActorMcCoy, 6945, 3);
Sound_Play(kSfxBR034_1A, 50, 0, 0, 50);
Actor_Clue_Acquire(kActorMcCoy, kClueLucyWithDektora, true, -1);
}
- return true;
+ retValue = true;
}
- return false;
+ break;
case 4:
if (region == 11) {
@@ -293,7 +298,7 @@ bool ESPERScript::SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region
Actor_Clue_Acquire(kActorMcCoy, kClueScorpions, true, -1);
}
}
- return false;
+ break;
case 5:
if (region == 13) {
@@ -304,7 +309,7 @@ bool ESPERScript::SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region
Actor_Clue_Acquire(kActorMcCoy, kClueStrangeScale2, true, -1);
}
}
- return false;
+ break;
case 6:
if (region == 14) {
@@ -322,7 +327,7 @@ bool ESPERScript::SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region
Actor_Clue_Acquire(kActorMcCoy, kClueIzosFriend, true, -1);
}
}
- return false;
+ break;
case 7:
if (region == 16) {
@@ -340,7 +345,7 @@ bool ESPERScript::SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region
Actor_Clue_Acquire(kActorMcCoy, kClueGuzza, true, -1);
}
}
- return false;
+ break;
case 8:
switch (region) {
@@ -381,8 +386,11 @@ bool ESPERScript::SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region
Actor_Clue_Acquire(kActorMcCoy, kCluePlasticExplosive, true, -1);
}
break;
+
+ default:
+ break;
}
- return false;
+ break;
case 9:
switch (region) {
@@ -420,10 +428,17 @@ bool ESPERScript::SCRIPT_ESPER_DLL_Special_Region_Selected(int photo, int region
Actor_Clue_Acquire(kActorMcCoy, kClueSadikAtMoonbus, true, -1);
}
break;
+
+ default:
+ break;
}
- return false;
+ break;
+
+ default:
+ break;
}
- return false;
+
+ return retValue;
}
} // End of namespace BladeRunner