aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2017-12-29 21:16:11 -0500
committerPaul Gilbert2017-12-29 21:16:11 -0500
commitd0c04053dd2acce2a9afa675099d304cbf7c9a70 (patch)
tree44b6c0cca90f498e0a2a99ccd34ac1fe6989e28f
parent9d336539b777fba380e980e0836d50d15b5e6704 (diff)
downloadscummvm-rg350-d0c04053dd2acce2a9afa675099d304cbf7c9a70.tar.gz
scummvm-rg350-d0c04053dd2acce2a9afa675099d304cbf7c9a70.tar.bz2
scummvm-rg350-d0c04053dd2acce2a9afa675099d304cbf7c9a70.zip
XEEN: Fix intermittant crash leaving Dwarf Mine
-rw-r--r--engines/xeen/scripts.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 74b7eb3f5c..59e12f6289 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -468,7 +468,8 @@ bool Scripts::cmdTeleport(ParamsIterator &params) {
Sound &sound = *_vm->_sound;
windows.closeAll();
-
+
+ bool restartFlag = _event->_opcode == OP_TeleportAndContinue;
int mapId = params.readByte();
Common::Point pt;
@@ -519,11 +520,13 @@ bool Scripts::cmdTeleport(ParamsIterator &params) {
events.clearEvents();
- if (_event->_opcode == OP_TeleportAndContinue) {
+ if (restartFlag) {
+ // Draw the new location and start any script at that location
intf.draw3d(true);
_lineNum = 0;
return true;
} else {
+ // Stop executing the script
return cmdExit(params);
}
}