diff options
Diffstat (limited to 'engines/director/lingo')
-rw-r--r-- | engines/director/lingo/lingo.cpp | 14 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index 1fd4a43c3b..e6b4e11d49 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -282,8 +282,8 @@ Symbol *Lingo::getHandler(Common::String &name) { return _handlers[entityIndex]; } -void Lingo::processEvent(LEvent event, int entityId) { - if (entityId <= 0) +void Lingo::processEvent(LEvent event, ScriptType st, int entityId) { + if (entityId <= 0) return; _currentEntityId = entityId; @@ -291,13 +291,11 @@ void Lingo::processEvent(LEvent event, int entityId) { if (!_eventHandlerTypes.contains(event)) error("processEvent: Unknown event %d for entity %d", event, entityId); - ScriptType st = event2script(event); - - if (st != kNoneScript) { - executeScript(st, entityId + 1); - } else if (_handlers.contains(ENTITY_INDEX(event, entityId))) { - call(_eventHandlerTypes[event], 0); + if (_handlers.contains(ENTITY_INDEX(event, entityId))) { + call(_eventHandlerTypes[event], 0); //D4+ Events pop(); + } else if (_scripts[st].contains(entityId)) { + executeScript(st, entityId + 1); //D3 list of scripts. } else { debugC(8, kDebugLingoExec, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId); } diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index 41d0444a32..dc796d7760 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -181,7 +181,7 @@ public: ScriptType event2script(LEvent ev); Symbol *getHandler(Common::String &name); - void processEvent(LEvent event, int entityId); + void processEvent(LEvent event, ScriptType st, int entityId); void initBuiltIns(); void initFuncs(); |