summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index 6bcc624..89d8b1c 100644
--- a/init.lua
+++ b/init.lua
@@ -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)