mirror of
https://repo.or.cz/minetest_hudbars.git
synced 2024-08-20 13:16:07 +02:00
Fix crash HP changed before player was registered
This commit is contained in:
parent
e11a52d8fb
commit
ea58a71e17
6
init.lua
6
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)
|
||||
|
Loading…
Reference in New Issue
Block a user