Fix: crash in player_events
This commit is contained in:
parent
308932b9b5
commit
073c2288e3
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user