forked from mtcontrib/minetest_hbarmor
More cleanup
This commit is contained in:
parent
2061c1bbf8
commit
640e154fb2
13
init.lua
13
init.lua
@ -77,21 +77,16 @@ minetest.register_on_leaveplayer(function(player)
|
|||||||
hud.player_active[name] = false
|
hud.player_active[name] = false
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_respawnplayer(function(player)
|
|
||||||
end)
|
|
||||||
|
|
||||||
local main_timer = 0
|
local main_timer = 0
|
||||||
local timer = 0
|
local timer = 0
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
main_timer = main_timer + dtime
|
main_timer = main_timer + dtime
|
||||||
timer = timer + dtime
|
timer = timer + dtime
|
||||||
if main_timer > HUD_TICK or timer > 4 then
|
if main_timer > HUD_TICK or timer > 4 then
|
||||||
if main_timer > HUD_TICK then main_timer = 0 end
|
if minetest.setting_getbool("enable_damage") then
|
||||||
for _,player in ipairs(minetest.get_connected_players()) do
|
if main_timer > HUD_TICK then main_timer = 0 end
|
||||||
local name = player:get_player_name()
|
for _,player in ipairs(minetest.get_connected_players()) do
|
||||||
|
local name = player:get_player_name()
|
||||||
-- only proceed if damage is enabled
|
|
||||||
if minetest.setting_getbool("enable_damage") then
|
|
||||||
if hud.player_active[name] == true then
|
if hud.player_active[name] == true then
|
||||||
hud.get_armor(player)
|
hud.get_armor(player)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user