Fix: crash in player_events

This commit is contained in:
Coder12a 2019-05-03 00:27:59 -05:00
parent 308932b9b5
commit 073c2288e3
1 changed files with 4 additions and 3 deletions

View File

@ -64,19 +64,20 @@ minetest.register_on_leaveplayer(
return return
end end
factions.onlineplayers[facname] = nil factions.onlineplayers[facname] = nil
on_death[pname] = nil on_death[name] = nil
end end
end end
) )
minetest.register_on_respawnplayer( minetest.register_on_respawnplayer(
function(player) function(player)
local faction, facname = factions.get_player_faction(player:get_player_name()) local name = player:get_player_name()
local faction, facname = factions.get_player_faction(name)
if not faction then if not faction then
return false return false
else else
on_death[pname] = nil on_death[name] = nil
if not faction.spawn then if not faction.spawn then
return false return false
else else