diff options
author | Eugene Sandulenko | 2017-02-08 18:21:46 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-02-08 18:21:46 +0100 |
commit | 3aa660f4c7a4c427c895e6f45a0cf0021dd02d26 (patch) | |
tree | acb47feb3d5da6950f47ea6b9353935b87ba0bcb /engines | |
parent | 296dac6bc278400e3d17b4596de8e10f515c07f1 (diff) | |
download | scummvm-rg350-3aa660f4c7a4c427c895e6f45a0cf0021dd02d26.tar.gz scummvm-rg350-3aa660f4c7a4c427c895e6f45a0cf0021dd02d26.tar.bz2 scummvm-rg350-3aa660f4c7a4c427c895e6f45a0cf0021dd02d26.zip |
DIRECTOR: Lingo: Fix macro definition
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/lingo/lingo-codegen.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index dccb95e0c1..65f2b2d11a 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -196,8 +196,7 @@ void Lingo::cleanLocalVars() { for (SymbolHash::const_iterator h = _localvars->begin(); h != _localvars->end(); ++h) { if (!h->_value->global) { - Symbol *sym = h->_value; - delete sym; + delete h->_value; } } @@ -219,7 +218,11 @@ void Lingo::define(Common::String &name, int start, int nargs, Common::String *p sym->name = name; sym->type = HANDLER; - _handlers[ENTITY_INDEX(_eventHandlerTypeIds[name.c_str()], _currentEntityId)] = sym; + if (!_eventHandlerTypeIds.contains(name)) { + _builtins[name] = sym; + } else { + _handlers[ENTITY_INDEX(_eventHandlerTypeIds[name.c_str()], _currentEntityId)] = sym; + } } else { //we don't want to be here. The getHandler call should have used the EntityId and the result //should have been unique! |