File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change
1
+ -- cache setting
2
+ local enable_damage = core .setting_getbool (" enable_damage" ) == true
1
3
2
4
local health_bar_definition =
3
5
{
@@ -42,9 +44,8 @@ local function initialize_builtin_statbars(player)
42
44
player :hud_set_flags (player :hud_get_flags ())
43
45
end
44
46
45
- if player :hud_get_flags ().healthbar and
46
- core .is_yes (core .setting_get (" enable_damage" )) then
47
- if hud_ids [name ].id_healthbar == nil then
47
+ if player :hud_get_flags ().healthbar and enable_damage then
48
+ if hud_ids [name ].id_healthbar == nil then
48
49
health_bar_definition .number = player :get_hp ()
49
50
hud_ids [name ].id_healthbar = player :hud_add (health_bar_definition )
50
51
end
@@ -56,8 +57,7 @@ local function initialize_builtin_statbars(player)
56
57
end
57
58
58
59
if (player :get_breath () < 11 ) then
59
- if player :hud_get_flags ().breathbar and
60
- core .is_yes (core .setting_get (" enable_damage" )) then
60
+ if player :hud_get_flags ().breathbar and enable_damage then
61
61
if hud_ids [name ].id_breathbar == nil then
62
62
hud_ids [name ].id_breathbar = player :hud_add (breath_bar_definition )
63
63
end
You can’t perform that action at this time.
0 commit comments