[Scummvm-cvs-logs] CVS: residual lua.cpp,1.51,1.52

James Brown ender at users.sourceforge.net
Tue Mar 23 18:55:01 CET 2004


Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8878

Modified Files:
	lua.cpp 
Log Message:
X,Y can sometimes be nil to startMovie, so accept that to prevent the script dying when entering the garage.


Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- lua.cpp	24 Mar 2004 01:36:05 -0000	1.51
+++ lua.cpp	24 Mar 2004 02:43:59 -0000	1.52
@@ -1091,8 +1091,15 @@
 
 static void StartMovie() {
 	bool mode = getbool(2);
-	int x = check_int(3);
-	int y = check_int(4);
+	int x = 0;
+	int y = 0;
+
+	if (!lua_isnil(lua_getparam(4)))
+		x = check_int(4);
+
+	if (!lua_isnil(lua_getparam(3)))
+		y = check_int(3);
+
 	Engine::instance()->setMode(ENGINE_MODE_NORMAL);
 	pushbool(g_smush->play(luaL_check_string(1), x, y));
 }





More information about the Scummvm-git-logs mailing list