From 6ab161a518de5613b424ff0276994fba3117aabe Mon Sep 17 00:00:00 2001 From: MihailRis Date: Thu, 15 Oct 2026 21:28:38 +0300 Subject: [PATCH] add 'tps' argument to on_world_tick event --- src/logic/scripting/scripting.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/logic/scripting/scripting.cpp b/src/logic/scripting/scripting.cpp index 3e5ecdbcd..8f3faf0e2 100644 --- a/src/logic/scripting/scripting.cpp +++ b/src/logic/scripting/scripting.cpp @@ -345,7 +345,9 @@ void scripting::on_world_tick(int tps) { lua::pop(L); } for (auto& pack : content_control->getAllContentPacks()) { - lua::emit_event(L, pack.id + ":.worldtick"); + lua::emit_event(L, pack.id + ":.worldtick", [tps](lua::State* L) { + return lua::pushinteger(L, tps); + }); } }