Allow minetest.get_player_by_name while leaving

Allow minetest.registered_on_leaveplayers to use minetest.get_player_by_name while the player is leaving.
This commit is contained in:
luk3yx 2018-04-14 08:33:35 +12:00
parent a05b314ccc
commit 398dec3d82
1 changed files with 2 additions and 2 deletions

View File

@ -124,8 +124,6 @@ cloaking.cloak = function(player)
player:set_properties({visual_size = {x = 0, y = 0}, collisionbox = {0,0,0,0,0,0}})
p:set_nametag_attributes({text = " "})
cloaked_players[victim] = true
local t = nil
if areas and areas.hud and areas.hud[victim] then
t = areas.hud[victim]
@ -137,6 +135,8 @@ cloaking.cloak = function(player)
end
end
cloaked_players[victim] = true
if t then
areas.hud[victim] = t
p:hud_change(areas.hud[victim].areasId, "text", "Cloaked")