Notify server that CSM is in use

This commit is contained in:
AFCMS 2022-12-09 23:11:24 +01:00
parent 7e31e4cea6
commit cf6dd79a82
Signed by: AFCMS
GPG Key ID: 8720389A25B652E3
1 changed files with 14 additions and 0 deletions

View File

@ -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