From 5dfd32df1b48d83bf49620c8fe64b4638dcdff87 Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Fri, 28 Jun 2019 19:11:50 -0500 Subject: [PATCH] Remove: ip if player is not in a faction --- player_events.lua | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/player_events.lua b/player_events.lua index dac592a..2453aca 100644 --- a/player_events.lua +++ b/player_events.lua @@ -54,19 +54,14 @@ minetest.register_on_leaveplayer(function(player) faction.last_logon = os.time() factions.factions.set(facname, faction) factions.onlineplayers[facname][name] = nil - local id_name2 = name .. "factionName" - local id_name3 = name .. "powerWatch" - if hud_ids[id_name2] then - hud_ids[id_name2] = nil - end - if hud_ids[id_name3] then - hud_ids[id_name3] = nil - end - - factions.onlineplayers[facname] = nil - on_death[name] = nil + hud_ids[name .. "factionName"] = nil + hud_ids[name .. "powerWatch"] = nil + else + factions.remove_key(factions.player_ips, name, nil, "ip", true) end + + on_death[name] = nil end )