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,20 +775,24 @@ int luacon_graphicsReplacement(GRAPHICS_FUNC_ARGS, int i)
|
|||||||
lua_pushinteger(luacon_ci->l, *colb);
|
lua_pushinteger(luacon_ci->l, *colb);
|
||||||
callret = lua_pcall(luacon_ci->l, 4, 10, 0);
|
callret = lua_pcall(luacon_ci->l, 4, 10, 0);
|
||||||
if (callret)
|
if (callret)
|
||||||
luacon_ci->Log(CommandInterface::LogError, luacon_geterror());
|
{
|
||||||
|
luacon_ci->Log(CommandInterface::LogError, luaL_optstring(luacon_ci->l, -1, ""));
|
||||||
cache = luaL_optint(luacon_ci->l, -10, 0);
|
lua_pop(luacon_ci->l, 1);
|
||||||
*pixel_mode = luaL_optint(luacon_ci->l, -9, *pixel_mode);
|
}
|
||||||
*cola = luaL_optint(luacon_ci->l, -8, *cola);
|
else
|
||||||
*colr = luaL_optint(luacon_ci->l, -7, *colr);
|
{
|
||||||
*colg = luaL_optint(luacon_ci->l, -6, *colg);
|
cache = luaL_optint(luacon_ci->l, -10, 0);
|
||||||
*colb = luaL_optint(luacon_ci->l, -5, *colb);
|
*pixel_mode = luaL_optint(luacon_ci->l, -9, *pixel_mode);
|
||||||
*firea = luaL_optint(luacon_ci->l, -4, *firea);
|
*cola = luaL_optint(luacon_ci->l, -8, *cola);
|
||||||
*firer = luaL_optint(luacon_ci->l, -3, *firer);
|
*colr = luaL_optint(luacon_ci->l, -7, *colr);
|
||||||
*fireg = luaL_optint(luacon_ci->l, -2, *fireg);
|
*colg = luaL_optint(luacon_ci->l, -6, *colg);
|
||||||
*fireb = luaL_optint(luacon_ci->l, -1, *fireb);
|
*colb = luaL_optint(luacon_ci->l, -5, *colb);
|
||||||
lua_pop(luacon_ci->l, 10);
|
*firea = luaL_optint(luacon_ci->l, -4, *firea);
|
||||||
|
*firer = luaL_optint(luacon_ci->l, -3, *firer);
|
||||||
|
*fireg = luaL_optint(luacon_ci->l, -2, *fireg);
|
||||||
|
*fireb = luaL_optint(luacon_ci->l, -1, *fireb);
|
||||||
|
lua_pop(luacon_ci->l, 10);
|
||||||
|
}
|
||||||
return cache;
|
return cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user