[Scummvm-git-logs] scummvm master -> c6391c709e4cdbb3585dad5b37644d5c43a1b670

mistydemeo noreply at scummvm.org
Sat Oct 22 16:14:37 UTC 2022


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:
c6391c709e DIRECTOR: handle go with multiple int arguments


Commit: c6391c709e4cdbb3585dad5b37644d5c43a1b670
    https://github.com/scummvm/scummvm/commit/c6391c709e4cdbb3585dad5b37644d5c43a1b670
Author: Misty De Meo (mistydemeo at gmail.com)
Date: 2022-10-22T09:14:34-07:00

Commit Message:
DIRECTOR: handle go with multiple int arguments

While `go` is intended to be called with either one int arugment or
one string and one int argument, Director accepts multiple int args.
In this case, it treats the first argument as an integer and silently
discards the rest. Before this branch, ScummVM would always treat two
arguments as being the movie + frame case and throw a typecheck error
for the first argument. This fixes it by checking the type of the first
arg and discarding the rest, matching Director's behaviour.

This was seen on the title screen of Wallobee Jack: The Thai Sun Adventure,
which calls it like so: `go (the frame) 0`

Changed paths:
    engines/director/lingo/lingo-builtins.cpp


diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 3080139da00..dad2e4190fc 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1328,10 +1328,16 @@ void LB::b_go(int nargs) {
 			Datum movie;
 			Datum frame;
 
-			if (nargs > 0) {
+			if (nargs > 0 && firstArg.type == STRING) {
 				movie = firstArg;
 				TYPECHECK(movie, STRING);
 
+				frame = g_lingo->pop();
+				nargs -= 1;
+			// Even if there's more than one argument, if the first
+			// arg is an int, Director discards the remainder and
+			// treats it as the frame.
+			} else if (nargs > 0 && firstArg.type == INT) {
 				frame = g_lingo->pop();
 				nargs -= 1;
 			} else {




More information about the Scummvm-git-logs mailing list