mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-10 18:34:21 +02:00
fix crash when doing simulation = nil in the console
This commit is contained in:
@@ -3313,7 +3313,11 @@ bool LuaScriptInterface::OnMouseTick()
|
|||||||
void LuaScriptInterface::OnTick()
|
void LuaScriptInterface::OnTick()
|
||||||
{
|
{
|
||||||
lua_getglobal(l, "simulation");
|
lua_getglobal(l, "simulation");
|
||||||
lua_pushinteger(l, luacon_sim->NUM_PARTS); lua_setfield(l, -2, "NUM_PARTS");
|
if (lua_istable(l, -1))
|
||||||
|
{
|
||||||
|
lua_pushinteger(l, luacon_sim->NUM_PARTS);
|
||||||
|
lua_setfield(l, -2, "NUM_PARTS");
|
||||||
|
}
|
||||||
lua_pop(l, 1);
|
lua_pop(l, 1);
|
||||||
ui::Engine::Ref().LastTick(Platform::GetTime());
|
ui::Engine::Ref().LastTick(Platform::GetTime());
|
||||||
luacon_step(luacon_mousex, luacon_mousey);
|
luacon_step(luacon_mousex, luacon_mousey);
|
||||||
|
Reference in New Issue
Block a user