mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-02 23:49:40 +00:00
DIRECTOR: LINGO: Allow on-demand creation of globals
This commit is contained in:
parent
2df444cecb
commit
8e738e4b12
@ -327,10 +327,12 @@ void LC::cb_globalassign() {
|
||||
|
||||
Symbol *s = g_lingo->lookupVar(name.c_str(), false);
|
||||
if (!s) {
|
||||
warning("Variable %s not found", name.c_str());
|
||||
g_lingo->pop();
|
||||
return;
|
||||
} else if (s && !s->global) {
|
||||
// Lingo lets you declare globals inside a method.
|
||||
// This doesn't define them in the script list, but you can still
|
||||
// read and write to them???
|
||||
s = g_lingo->lookupVar(name.c_str(), true, true);
|
||||
}
|
||||
if (s && !s->global) {
|
||||
warning("Variable %s is local, not global", name.c_str());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user