[Scummvm-git-logs] scummvm master -> 39d1b595dcdce5cbd4afb26df7343074192e1175
sev-
noreply at scummvm.org
Sat Jan 28 21:35:12 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
39d1b595dc DIRECTOR: Allow calling 'the' keywords as functions
Commit: 39d1b595dcdce5cbd4afb26df7343074192e1175
https://github.com/scummvm/scummvm/commit/39d1b595dcdce5cbd4afb26df7343074192e1175
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-01-28T22:34:56+01:00
Commit Message:
DIRECTOR: Allow calling 'the' keywords as functions
The original was quite relaxed in this regard.
timegal-mac-ja: Time Gal
Example:
put timer() into tt
if timer() < tt + 480 then
Changed paths:
engines/director/lingo/lingo-code.cpp
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index 5810c17ff5d..fe0c19e0384 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -1557,10 +1557,25 @@ void LC::call(const Symbol &funcSym, int nargs, bool allowRetVal) {
Datum target = funcSym.target;
if (funcSym.type == VOIDSYM) {
- if (funcSym.name)
+ if (funcSym.name) {
+ // Lingo was also treating all 'the' entities as functions
+ if (g_lingo->_theEntities.contains(*funcSym.name) && nargs == 0) {
+ warning("Calling builtin '%s' as a function", funcSym.name->c_str());
+
+ TheEntity *entity = g_lingo->_theEntities[*funcSym.name];
+ Datum id;
+ id.u.i = 0;
+ id.type = VOID;
+
+ g_lingo->push(g_lingo->getTheEntity(entity->entity, id, 0));
+
+ return;
+ }
+
g_lingo->lingoError("Call to undefined handler '%s'. Dropping %d stack items", funcSym.name->c_str(), nargs);
- else
+ } else {
g_lingo->lingoError("Call to undefined handler. Dropping %d stack items", nargs);
+ }
for (int i = 0; i < nargs; i++)
g_lingo->pop();
More information about the Scummvm-git-logs
mailing list