forked from mtcontrib/minetest_hbarmor
Fetch armor value before init_hudbar
This commit is contained in:
parent
211a0fd1b2
commit
b169a0307d
2
init.lua
2
init.lua
@ -34,6 +34,7 @@ local function custom_hud(player)
|
|||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
|
||||||
if minetest.setting_getbool("enable_damage") then
|
if minetest.setting_getbool("enable_damage") then
|
||||||
|
hbarmor.get_armor(player)
|
||||||
local arm = tonumber(hbarmor.armor[name])
|
local arm = tonumber(hbarmor.armor[name])
|
||||||
if not arm then arm = 0 end
|
if not arm then arm = 0 end
|
||||||
local hide
|
local hide
|
||||||
@ -76,7 +77,6 @@ end
|
|||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
hbarmor.armor[name] = 0
|
|
||||||
custom_hud(player)
|
custom_hud(player)
|
||||||
hbarmor.player_active[name] = true
|
hbarmor.player_active[name] = true
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user