aboutsummaryrefslogtreecommitdiff
path: root/engines/director/lingo
diff options
context:
space:
mode:
authorEugene Sandulenko2017-02-09 09:23:13 +0100
committerEugene Sandulenko2017-02-09 09:23:13 +0100
commit5370377943a899882def15c61c3e7aaadfb572e0 (patch)
tree603be48389c2145da96c1d9db62ef6f3e9e225bd /engines/director/lingo
parent73cf9721e30312d43f51f5a05b8db825c8d805fd (diff)
downloadscummvm-rg350-5370377943a899882def15c61c3e7aaadfb572e0.tar.gz
scummvm-rg350-5370377943a899882def15c61c3e7aaadfb572e0.tar.bz2
scummvm-rg350-5370377943a899882def15c61c3e7aaadfb572e0.zip
DIRECTOR: Lingo: Fix global symbol processing
Diffstat (limited to 'engines/director/lingo')
-rw-r--r--engines/director/lingo/lingo-code.cpp2
-rw-r--r--engines/director/lingo/lingo-codegen.cpp4
2 files changed, 5 insertions, 1 deletions
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;