diff options
author | Eugene Sandulenko | 2017-02-22 13:27:53 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-02-22 13:27:53 +0100 |
commit | 58d393b314d95082612193838be86b24e09c3b30 (patch) | |
tree | 87e9318bba9f8edd91b7f53f033a943b14a18f86 | |
parent | 0b64be9773a09ba9349a44dc9eaa87260a6eaa0d (diff) | |
download | scummvm-rg350-58d393b314d95082612193838be86b24e09c3b30.tar.gz scummvm-rg350-58d393b314d95082612193838be86b24e09c3b30.tar.bz2 scummvm-rg350-58d393b314d95082612193838be86b24e09c3b30.zip |
DIRECTOR: Lingo: Fix when..then execution
-rw-r--r-- | engines/director/lingo/lingo-code.cpp | 5 | ||||
-rw-r--r-- | engines/director/lingo/lingo.cpp | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index 3dead580da..ca04dce550 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -940,8 +940,13 @@ void Lingo::c_whencode() { debugC(3, kDebugLingoExec, "c_whencode([%5d][%5d], %s)", start, end, eventname.c_str()); + int entity = g_lingo->_currentEntityId; + g_lingo->_currentEntityId = 0; + g_lingo->define(eventname, start, 0, NULL, end); + g_lingo->_currentEntityId = entity; + if (debugChannelSet(3, kDebugLingoExec)) { uint pc = start; while (pc <= end) { diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index cf0038bfdc..32a247a83f 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -291,7 +291,7 @@ Symbol *Lingo::getHandler(Common::String &name) { } void Lingo::processEvent(LEvent event, ScriptType st, int entityId) { - if (entityId <= 0) + if (entityId < 0) return; debugC(1, kDebugEvents, "Lingo::processEvent(%s, %s, %d)", _eventHandlerTypes[event], scriptType2str(st), entityId); |