From 5370377943a899882def15c61c3e7aaadfb572e0 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 9 Feb 2017 09:23:13 +0100 Subject: DIRECTOR: Lingo: Fix global symbol processing --- engines/director/lingo/lingo-code.cpp | 2 +- engines/director/lingo/lingo-codegen.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index 53f3a5aa3e..7ab69c025d 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -341,7 +341,7 @@ void Lingo::c_assign() { } bool Lingo::verify(Symbol *s) { - if (s->type != INT && s->type != VOID && s->type != FLOAT && s->type != STRING && s->type != POINT) { + if (s->type != INT && s->type != VOID && s->type != FLOAT && s->type != STRING && s->type != POINT && s->type != SYMBOL) { warning("attempt to evaluate non-variable '%s'", s->name.c_str()); return false; diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp index 94fe7068a4..95501677b7 100644 --- a/engines/director/lingo/lingo-codegen.cpp +++ b/engines/director/lingo/lingo-codegen.cpp @@ -166,6 +166,10 @@ 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) + return _globalvars[name]; + if (!create) return NULL; -- cgit v1.2.3