aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanasis Antoniou2019-07-14 02:18:34 +0300
committerThanasis Antoniou2019-07-14 02:18:34 +0300
commit509738bb494247f2232b5b91719dba43b31fd661 (patch)
tree52558017b9d73ab7aa31c2e20f5c66aa7b76d71d
parent9c5d96f68fd83093e67485d4e6cfa0a6cb46e11b (diff)
downloadscummvm-rg350-509738bb494247f2232b5b91719dba43b31fd661.tar.gz
scummvm-rg350-509738bb494247f2232b5b91719dba43b31fd661.tar.bz2
scummvm-rg350-509738bb494247f2232b5b91719dba43b31fd661.zip
BLADERUNNER: Fix seg fault at load from ScummVM menu
Happened if player was clicking mouse furiously while loading from the ScummVM GUI
-rw-r--r--engines/bladerunner/bladerunner.cpp1
-rw-r--r--engines/bladerunner/script/scene_script.cpp5
2 files changed, 4 insertions, 2 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index ecb4048233..8c729a7b36 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -374,7 +374,6 @@ Common::Error BladeRunnerEngine::run() {
// else {
// newGame(kGameDifficultyMedium);
// }
-
gameLoop();
_mouse->disable();
diff --git a/engines/bladerunner/script/scene_script.cpp b/engines/bladerunner/script/scene_script.cpp
index 8cfe8b3055..14b353dcf4 100644
--- a/engines/bladerunner/script/scene_script.cpp
+++ b/engines/bladerunner/script/scene_script.cpp
@@ -182,7 +182,10 @@ bool SceneScript::mouseClick(int x, int y) {
_inScriptCounter++;
_mouseX = x;
_mouseY = y;
- bool result = _currentScript->MouseClick(x, y);
+ bool result = false;
+ if (_currentScript != nullptr) {
+ result = _currentScript->MouseClick(x, y);
+ }
_vm->_runningActorId = -1;
_inScriptCounter--;
_mouseX = -1;