diff options
author | Paul Gilbert | 2014-11-10 13:35:15 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-12-12 22:29:58 -0500 |
commit | 4d82191f34c2c08f250914f52b183914e26e4df9 (patch) | |
tree | 4cecd7102c1c23bde9ddfe33d1f02362f275d31b | |
parent | 340a3fa91bc6168f5e073a33afd48a083fb14d10 (diff) | |
download | scummvm-rg350-4d82191f34c2c08f250914f52b183914e26e4df9.tar.gz scummvm-rg350-4d82191f34c2c08f250914f52b183914e26e4df9.tar.bz2 scummvm-rg350-4d82191f34c2c08f250914f52b183914e26e4df9.zip |
ACCESS: Fix crashes for scene debugger command when launched from cmdCheckTimer
-rw-r--r-- | engines/access/scripts.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp index 9f321947f2..34d5372b56 100644 --- a/engines/access/scripts.cpp +++ b/engines/access/scripts.cpp @@ -46,6 +46,7 @@ Scripts::~Scripts() { void Scripts::setScript(Resource *res) { _resource = res; _data = res->_stream; + _endFlag = true; } void Scripts::freeScriptData() { @@ -416,6 +417,12 @@ void Scripts::cmdCheckTimer() { _vm->_events->pollEvents(); _vm->_canSaveLoad = false; + // Since the ScummVM debugger can be launched from the above point, we need + // to check whether the script needs to be ended here, since some commands, + // like the scene command, can change the current script + if (_endFlag) + return; + if ((idx == 9) && (_vm->_events->_keypresses.size() > 0)) { _vm->_events->zeroKeys(); _vm->_timers[9]._timer = 0; |