check player valid when respawn, cos update healt cannot check

* update_health canot made a check player cos its called already
  in other places where such check is made, but at respawn moment
  the player object is not checked so we must made it manually
  and not a double check in update_healt due performancde issues
This commit is contained in:
mckaygerhard 2023-07-23 22:09:44 -04:00
parent c435ee31b3
commit 1b24c014dc

View File

@ -594,7 +594,9 @@ minetest.register_on_player_hpchange(function(player)
end)
minetest.register_on_respawnplayer(function(player)
if player_exists(player) then
update_health(player)
end
hb.hide_hudbar(player, "breath")
end)