fix stack overflow error

This commit is contained in:
MihailRis 2026-09-02 00:11:45 +03:00
parent 372214ab73
commit 507ff7ac93
2 changed files with 2 additions and 0 deletions

View file

@ -639,6 +639,7 @@ namespace lua {
inline void call_internal(lua::State* L, const std::string& name) { inline void call_internal(lua::State* L, const std::string& name) {
if (lua::get_from_registry(L, lua::INTERNALS_TABLE, name, true)) { if (lua::get_from_registry(L, lua::INTERNALS_TABLE, name, true)) {
lua::call_nothrow(L, 0, 0); lua::call_nothrow(L, 0, 0);
pop(L);
} }
} }

View file

@ -334,6 +334,7 @@ void scripting::on_world_tick(int tps) {
if (lua::get_from_registry(L, lua::INTERNALS_TABLE, "on_world_tick", true)) { if (lua::get_from_registry(L, lua::INTERNALS_TABLE, "on_world_tick", true)) {
lua::pushinteger(L, tps); lua::pushinteger(L, tps);
lua::call_nothrow(L, 1, 0); lua::call_nothrow(L, 1, 0);
lua::pop(L);
} }
for (auto& pack : content_control->getAllContentPacks()) { for (auto& pack : content_control->getAllContentPacks()) {
lua::emit_event(L, pack.id + ":.worldtick"); lua::emit_event(L, pack.id + ":.worldtick");