ACCESS: Fix crashes for scene debugger command when launched from cmdCheckTimer

This commit is contained in:
Paul Gilbert 2014-11-10 13:35:15 -05:00
parent 340a3fa91b
commit 4d82191f34

View file

@ -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;