From cad2567d5c412e1017a4206002300c94e34cbe67 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Sun, 14 Jul 2019 19:17:17 +1200 Subject: [PATCH] csm_strict/init.lua: More fixes --- csm_strict/init.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/csm_strict/init.lua b/csm_strict/init.lua index f095487..f006d88 100644 --- a/csm_strict/init.lua +++ b/csm_strict/init.lua @@ -223,12 +223,13 @@ base_env:set('join_mod_channel', function() end end) -base_env:set('leave_mod_channel', function() +local function leave_mod_channel() if mod_channel then mod_channel:leave() mod_channel = false end -end) +end +base_env:set('leave_mod_channel', leave_mod_channel) -- Allow other CSMs to access the new Environment type sscsm.Env = Env @@ -324,6 +325,7 @@ end local allow_id, deny_id, inspect_id local function show_default_formspec() + leave_mod_channel() local allow_text, deny_text, allowed if sscsm.allowed then deny_text = 'Exit to menu' @@ -383,6 +385,7 @@ local inspect_file = 1 local function show_inspect_formspec() if not sscsm_queue then return end + if not inspecting then inspecting = random_identifier() minetest.display_chat_message('[SSCSM] If the number displayed in' .. @@ -446,10 +449,6 @@ minetest.register_on_formspec_input(function(formname, fields) if sscsm.allowed then minetest.disconnect() end - if mod_channel then - mod_channel:leave() - mod_channel = false - end if sscsm_queue then sscsm_queue = false minetest.display_chat_message('[SSCSM] SSCSMs have been denied.')