diff options
-rw-r--r-- | engines/director/lingo/lingo-builtins.cpp | 6 | ||||
-rw-r--r-- | engines/director/lingo/lingo-code.cpp | 5 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 3 |
3 files changed, 13 insertions, 1 deletions
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp index 3c888c1b09..f20d1bfe1c 100644 --- a/engines/director/lingo/lingo-builtins.cpp +++ b/engines/director/lingo/lingo-builtins.cpp @@ -634,7 +634,11 @@ void Lingo::factoryCall(Common::String &name, int nargs) { printStubWithArglist(s.c_str(), nargs); - dropStack(nargs); + Datum method = _stack[_stack.size() - nargs + 0]; + + s = name + "-" + *method.u.s; + + call(s, nargs); } } // End of namespace Director diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp index fe2b82e5f9..0d4afca908 100644 --- a/engines/director/lingo/lingo-code.cpp +++ b/engines/director/lingo/lingo-code.cpp @@ -718,6 +718,11 @@ void Lingo::c_call() { g_lingo->_pc += g_lingo->calcStringAlignment(name.c_str()); int nargs = READ_UINT32(&(*g_lingo->_currentScript)[g_lingo->_pc++]); + + g_lingo->call(name, nargs); +} + +void Lingo::call(Common::String &name, int nargs) { bool drop = false; Symbol *sym; diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index a51988c908..90adcbb972 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -240,6 +240,9 @@ public: static void c_ge(); static void c_le(); static void c_call(); + + void call(Common::String &name, int nargs); + static void c_procret(); static void c_mci(); |