diff options
author | Wuzzy <almikes@aol.com> | 2017-02-25 02:04:15 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2017-02-25 02:04:15 +0100 |
commit | ea58a71e17ad29a5e6b69cacf1d7ff2d424d18d6 (patch) | |
tree | 45c3d3bffcc77aeed8c8a3b0e3e83f44f54648f8 | |
parent | e11a52d8fba15ec04226d4659a8aeb9dc59eb632 (diff) |
Fix crash HP changed before player was registered
-rw-r--r-- | init.lua | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) |