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");