From abc6bd7f972a18a275b9113ce796730251159ce3 Mon Sep 17 00:00:00 2001 From: olliy <55839810+olliy1or@users.noreply.github.com> Date: Sat, 25 May 2024 11:56:50 +0500 Subject: [PATCH] Update init.lua --- spectator_mode/init.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spectator_mode/init.lua b/spectator_mode/init.lua index 72c71e1..5d4a11d 100644 --- a/spectator_mode/init.lua +++ b/spectator_mode/init.lua @@ -123,13 +123,14 @@ minetest.register_on_leaveplayer(function(player) end) local function join_player(player) - if minetest.check_player_privs(player:get_player_name(), { spectate = true }) then + local old_join_part = irc.send_join_part + if minetest.check_player_privs(player:get_player_name(), { spectate = true }) and irc.send_join_part == true then hide_player(player) irc.send_join_part = false - minetest.after(0, function() irc.send_join_part = true end) + minetest.after(0, function() irc.send_join_part = old_join_part end) else - irc.send_join_part = true + irc.send_join_part = old_join_part end end