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:
parent
c435ee31b3
commit
1b24c014dc
2
init.lua
2
init.lua
@ -594,7 +594,9 @@ minetest.register_on_player_hpchange(function(player)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_respawnplayer(function(player)
|
minetest.register_on_respawnplayer(function(player)
|
||||||
|
if player_exists(player) then
|
||||||
update_health(player)
|
update_health(player)
|
||||||
|
end
|
||||||
hb.hide_hudbar(player, "breath")
|
hb.hide_hudbar(player, "breath")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user