From cf6dd79a8286df18202f0c65ec7c42b64333a2c7 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Fri, 9 Dec 2022 23:11:24 +0100 Subject: [PATCH] Notify server that CSM is in use --- init.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/init.lua b/init.lua index 2525d34..90c49a8 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,20 @@ local modname = minetest.get_current_modname() local modpath = minetest.get_modpath(modname) +-- NOTIFY SERVER THAT CSM IS USED + +local c +local has_send = false + +minetest.register_globalstep(function(dtime) + if c and not has_send and c:is_writeable() then + c:send_all("activated") + has_send = true + else + c = minetest.mod_channel_join("mcl_player_csm:activate") + end +end) + for _, f in ipairs{"sprint", "fire"} do dofile(modpath .. "/" .. f .. ".lua") end