mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-07 02:12:14 +00:00
DIRECTOR: LINGO: Fix behaviour of global variables
This commit is contained in:
parent
ecaebf7ced
commit
d1cd2f5126
@ -179,7 +179,7 @@ Symbol *Lingo::lookupVar(const char *name, bool create, bool putInGlobalList) {
|
||||
|
||||
if (!_localvars || !_localvars->contains(name)) { // Create variable if it was not defined
|
||||
// Check if it is a global symbol
|
||||
if (_globalvars.contains(name) && _globalvars[name]->type == SYMBOL)
|
||||
if (_globalvars.contains(name))
|
||||
return _globalvars[name];
|
||||
|
||||
if (!create)
|
||||
@ -190,10 +190,11 @@ Symbol *Lingo::lookupVar(const char *name, bool create, bool putInGlobalList) {
|
||||
sym->type = VOID;
|
||||
sym->u.i = 0;
|
||||
|
||||
if (_localvars)
|
||||
(*_localvars)[name] = sym;
|
||||
if (!putInGlobalList) {
|
||||
if (_localvars)
|
||||
(*_localvars)[name] = sym;
|
||||
|
||||
if (putInGlobalList) {
|
||||
} else {
|
||||
sym->global = true;
|
||||
_globalvars[name] = sym;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user