From 507ff7ac9351b018cdbfc1239149b2c16ba28f60 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Wed, 2 Sep 2026 00:11:45 +0300 Subject: [PATCH] fix stack overflow error --- src/logic/scripting/lua/lua_util.hpp | 1 + src/logic/scripting/scripting.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/logic/scripting/lua/lua_util.hpp b/src/logic/scripting/lua/lua_util.hpp index 4ce6e2b51..61b56cef3 100644 --- a/src/logic/scripting/lua/lua_util.hpp +++ b/src/logic/scripting/lua/lua_util.hpp @@ -639,6 +639,7 @@ namespace lua { inline void call_internal(lua::State* L, const std::string& name) { if (lua::get_from_registry(L, lua::INTERNALS_TABLE, name, true)) { lua::call_nothrow(L, 0, 0); + pop(L); } } diff --git a/src/logic/scripting/scripting.cpp b/src/logic/scripting/scripting.cpp index de3f61079..87c07caf4 100644 --- a/src/logic/scripting/scripting.cpp +++ b/src/logic/scripting/scripting.cpp @@ -334,6 +334,7 @@ void scripting::on_world_tick(int tps) { if (lua::get_from_registry(L, lua::INTERNALS_TABLE, "on_world_tick", true)) { lua::pushinteger(L, tps); lua::call_nothrow(L, 1, 0); + lua::pop(L); } for (auto& pack : content_control->getAllContentPacks()) { lua::emit_event(L, pack.id + ":.worldtick");