aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script
diff options
context:
space:
mode:
authorThanasis Antoniou2019-05-13 23:20:14 +0300
committerThanasis Antoniou2019-05-13 23:20:14 +0300
commitc92d20d28a4eb95fea0e61086d47a58a2ca3b283 (patch)
tree35d495371ceb9509b41d47a0ebc1cb188d34455e /engines/bladerunner/script
parentfa171732e94362d10c9729ecdc604e4a5d28dc51 (diff)
downloadscummvm-rg350-c92d20d28a4eb95fea0e61086d47a58a2ca3b283.tar.gz
scummvm-rg350-c92d20d28a4eb95fea0e61086d47a58a2ca3b283.tar.bz2
scummvm-rg350-c92d20d28a4eb95fea0e61086d47a58a2ca3b283.zip
BLADERUNNER: Fix freeze for MA06 elevator
Diffstat (limited to 'engines/bladerunner/script')
-rw-r--r--engines/bladerunner/script/scene/ma06.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/engines/bladerunner/script/scene/ma06.cpp b/engines/bladerunner/script/scene/ma06.cpp
index 719dfd7db3..7e1e5303a3 100644
--- a/engines/bladerunner/script/scene/ma06.cpp
+++ b/engines/bladerunner/script/scene/ma06.cpp
@@ -21,6 +21,7 @@
*/
#include "bladerunner/script/scene_script.h"
+#include "common/debug.h"
namespace BladeRunner {
@@ -34,6 +35,12 @@ enum kMA06Loops {
void SceneScriptMA06::InitializeScene() {
Setup_Scene_Information(40.0f, 1.0f, -20.0f, 400);
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ Ambient_Sounds_Remove_All_Looping_Sounds(1);
+ Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
+#endif // BLADERUNNER_ORIGINAL_BUGS
+
Ambient_Sounds_Add_Looping_Sound(kSfxELEAMB3, 50, 0, 1);
Ambient_Sounds_Add_Looping_Sound(kSfxAPRTFAN1, 33, 0, 1);
@@ -232,6 +239,7 @@ void SceneScriptMA06::activateElevator() {
Game_Flag_Reset(kFlagMA06toMA01);
Game_Flag_Reset(kFlagMA06ToMA02);
Game_Flag_Reset(kFlagMA06toMA07);
+ int floor = 0;
while (true) {
if (Game_Flag_Query(kFlagMA06ToMA02)) {
break;
@@ -245,7 +253,15 @@ void SceneScriptMA06::activateElevator() {
Actor_Says(kActorAnsweringMachine, 80, kAnimationModeTalk);
Player_Gains_Control();
- int floor = Elevator_Activate(kElevatorMA);
+ floor = Elevator_Activate(kElevatorMA);
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ // Fix for a crash/ freeze bug;
+ // To reproduce original issue: in Act 4, visit Rajiff, then exit to ground floor. Re-enter elevator and press Alt+F4
+ if (floor < 0) {
+ break;
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
Player_Loses_Control();
Scene_Loop_Start_Special(kSceneLoopModeOnce, kMA06LoopMainLoop, true);