do not return after kicking one exiled player

This commit is contained in:
Tai Kedzierski 2019-01-30 11:44:49 +00:00
parent 241d947932
commit eb72c829e9

@ -378,14 +378,14 @@ minetest.register_globalstep(function(dtime)
kick_step = 0 kick_step = 0
end end
for _,guest in ipairs(minetest.get_connected_players()) do for _x,guest in ipairs(minetest.get_connected_players()) do
local guestname = guest:get_player_name() local guestname = guest:get_player_name()
local playerprivs = minetest.get_player_privs(guestname) local playerprivs = minetest.get_player_privs(guestname)
if not (playerprivs.basic_privs or playerprivs.server) then if not (playerprivs.basic_privs or playerprivs.server) then
local guestpos = guest:getpos() local guestpos = guest:getpos()
for _,player_list_name in ipairs({"guest lists", "town lists"}) do for _y,player_list_name in ipairs({"guest lists", "town lists"}) do
for hostname,host_guestlist in pairs(rspawn.playerspawns[player_list_name] or {}) do for hostname,host_guestlist in pairs(rspawn.playerspawns[player_list_name] or {}) do
if host_guestlist[guestname] == GUEST_BAN then if host_guestlist[guestname] == GUEST_BAN then
@ -401,11 +401,9 @@ minetest.register_globalstep(function(dtime)
guest:setpos(rspawn.playerspawns[guestname]) guest:setpos(rspawn.playerspawns[guestname])
minetest.chat_send_player(guestname, "You got too close to "..hostname.."'s turf.") minetest.chat_send_player(guestname, "You got too close to "..hostname.."'s turf.")
minetest.log("action", "[rspawn] Auto-kicked "..guestname.." for being too close to "..hostname.."'s spawn") minetest.log("action", "[rspawn] Auto-kicked "..guestname.." for being too close to "..hostname.."'s spawn")
return
elseif vdist < exile_distance*1.5 and sdist > exile_distance then elseif vdist < exile_distance*1.5 and sdist > exile_distance then
minetest.chat_send_player(guestname, "You are getting too close to "..hostname.."'s turf.") minetest.chat_send_player(guestname, "You are getting too close to "..hostname.."'s turf.")
return
end end
end end
end end