mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-11 02:43:58 +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()
|
||||
{
|
||||
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);
|
||||
ui::Engine::Ref().LastTick(Platform::GetTime());
|
||||
luacon_step(luacon_mousex, luacon_mousey);
|
||||
|
Reference in New Issue
Block a user