mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-07-31 05:30:23 +02:00
fix crash with sim.floodWalls(1,1,4,0)
This commit is contained in:
@@ -1378,6 +1378,11 @@ int LuaScriptInterface::simulation_floodWalls(lua_State * l)
|
|||||||
int bm = luaL_optint(l,4,-1);
|
int bm = luaL_optint(l,4,-1);
|
||||||
if (c < 0 || c >= UI_WALLCOUNT)
|
if (c < 0 || c >= UI_WALLCOUNT)
|
||||||
return luaL_error(l, "Unrecognised wall id '%d'", c);
|
return luaL_error(l, "Unrecognised wall id '%d'", c);
|
||||||
|
if (c == WL_STREAM)
|
||||||
|
{
|
||||||
|
lua_pushinteger(l, 0);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
int ret = luacon_sim->FloodWalls(x, y, c, bm);
|
int ret = luacon_sim->FloodWalls(x, y, c, bm);
|
||||||
lua_pushinteger(l, ret);
|
lua_pushinteger(l, ret);
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user