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

djsrv dservilla at gmail.com
Sun Jun 14 21:44:05 UTC 2020


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:
a97451ebdb DIRECTOR: LINGO: Handle empty string in b_value


Commit: a97451ebdb2bd8a7f857b55cde49c73fa5c8ed8a
    https://github.com/scummvm/scummvm/commit/a97451ebdb2bd8a7f857b55cde49c73fa5c8ed8a
Author: djsrv (dservilla at gmail.com)
Date: 2020-06-14T17:43:43-04:00

Commit Message:
DIRECTOR: LINGO: Handle empty string in b_value

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 9588c7a968..0a20e5da72 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -155,7 +155,7 @@ static struct BuiltinProto {
 	{ "quit",			LB::b_quit,			0, 0, false, 2, BLTIN },	// D2 c
 	{ "restart",		LB::b_restart,		0, 0, false, 2, BLTIN },	// D2 c
 	{ "return",			LB::b_return,		0, 1, false, 2, BLTIN },	// D2 f
-	{ "scummvm_returnNumber", LB::b_returnNumber, 0, 1, false, 2, BLTIN },	// D2 f
+	{ "scummvm_returnNumber", LB::b_returnNumber, 1, 1, false, 2, BLTIN },	// D2 f
 	{ "shutDown",		LB::b_shutDown,		0, 0, false, 2, BLTIN },	// D2 c
 	{ "startTimer",		LB::b_startTimer,	0, 0, false, 2, BLTIN },	// D2 c
 		// when keyDown													// D2
@@ -512,7 +512,12 @@ void LB::b_string(int nargs) {
 
 void LB::b_value(int nargs) {
 	Datum d = g_lingo->pop();
-	Common::String code = "scummvm_returnNumber " + d.asString();
+	Common::String expr = d.asString();
+	if (expr.empty()) {
+		g_lingo->push(Datum(0));
+		return;
+	}
+	Common::String code = "scummvm_returnNumber " + expr;
 	// Compile the code to an anonymous function and call it
 	ScriptContext *sc = g_lingo->addCode(code.c_str(), -1, kNoneScript, 0);
 	Symbol sym = sc->functions[0];




More information about the Scummvm-git-logs mailing list