mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-01 20:12:50 +02:00
Fixed graphics function crash when unable to catch errors
This commit is contained in:
@@ -775,8 +775,12 @@ int luacon_graphicsReplacement(GRAPHICS_FUNC_ARGS, int i)
|
||||
lua_pushinteger(luacon_ci->l, *colb);
|
||||
callret = lua_pcall(luacon_ci->l, 4, 10, 0);
|
||||
if (callret)
|
||||
luacon_ci->Log(CommandInterface::LogError, luacon_geterror());
|
||||
|
||||
{
|
||||
luacon_ci->Log(CommandInterface::LogError, luaL_optstring(luacon_ci->l, -1, ""));
|
||||
lua_pop(luacon_ci->l, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
cache = luaL_optint(luacon_ci->l, -10, 0);
|
||||
*pixel_mode = luaL_optint(luacon_ci->l, -9, *pixel_mode);
|
||||
*cola = luaL_optint(luacon_ci->l, -8, *cola);
|
||||
@@ -788,7 +792,7 @@ int luacon_graphicsReplacement(GRAPHICS_FUNC_ARGS, int i)
|
||||
*fireg = luaL_optint(luacon_ci->l, -2, *fireg);
|
||||
*fireb = luaL_optint(luacon_ci->l, -1, *fireb);
|
||||
lua_pop(luacon_ci->l, 10);
|
||||
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user