From e5515ed119f3cca83eee26860af05e5a1d0bc6ed Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 17 Nov 2022 20:06:00 +0100 Subject: [PATCH] Add debug field: active event counter to verify it doesn't memleak --- mods/CORE/mcl_events/init.lua | 7 +++++++ mods/CORE/mcl_events/mod.conf | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mods/CORE/mcl_events/init.lua b/mods/CORE/mcl_events/init.lua index 9c908846f1..4b0dcd81e7 100644 --- a/mods/CORE/mcl_events/init.lua +++ b/mods/CORE/mcl_events/init.lua @@ -131,6 +131,13 @@ end minetest.register_globalstep(check_events) +mcl_info.register_debug_field("Active Events",{ + level = 4, + func = function(pl,pos) + return tostring(#active_events) + end +}) + minetest.register_chatcommand("event_start",{ privs = {debug = true}, description = "Debug command to start events", diff --git a/mods/CORE/mcl_events/mod.conf b/mods/CORE/mcl_events/mod.conf index 44d11a1cce..29a45628ac 100644 --- a/mods/CORE/mcl_events/mod.conf +++ b/mods/CORE/mcl_events/mod.conf @@ -1,3 +1,3 @@ name = mcl_events author = cora -depends = mcl_mobs,mcl_bossbars +depends = mcl_mobs,mcl_bossbars, mcl_info