X,Y can sometimes be nil to startMovie, so accept that to prevent the script dying when entering the garage.

This commit is contained in:
James Brown 2004-03-24 02:43:59 +00:00
parent 5ec54ab780
commit 3cb5753213

11
lua.cpp
View file

@ -1091,8 +1091,15 @@ static void StartFullscreenMovie() {
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));
}