Skip to content

Commit

Permalink
Update init.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
olliy1or authored May 25, 2024
1 parent 6d4b031 commit abc6bd7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spectator_mode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit abc6bd7

Please sign in to comment.