Fix crash HP changed before player was registered

This commit is contained in:
Wuzzy 2017-02-25 02:04:15 +01:00
parent e11a52d8fb
commit ea58a71e17

@ -521,7 +521,11 @@ local function update_hud(player)
end
end
minetest.register_on_player_hpchange(update_health)
minetest.register_on_player_hpchange(function(player)
if hb.players[player:get_player_name()] ~= nil then
update_health(player)
end
end)
minetest.register_on_respawnplayer(function(player)
update_health(player)