Fix healthbar not beeing hidden on disabled damage
authorsapier <Sapier at GMX dot net>
Sat, 10 May 2014 21:32:25 +0000 (23:32 +0200)
committersapier <Sapier at GMX dot net>
Sat, 10 May 2014 21:32:25 +0000 (23:32 +0200)
builtin/game/statbars.lua

index 9e5699314af38162e6a229c9ef6a107ece0a4c81..ccc192ba4098dfe7b55a1f29d47916daa766106d 100644 (file)
@@ -39,7 +39,8 @@ local function initialize_builtin_statbars(player)
                hud_ids[name] = {}
        end
 
-       if player:hud_get_flags().healthbar then
+       if player:hud_get_flags().healthbar and
+                       core.is_yes(core.setting_get("enable_damage")) then
                if hud_ids[name].id_healthbar == nil then
                        health_bar_definition.number = player:get_hp()
                        hud_ids[name].id_healthbar  = player:hud_add(health_bar_definition)
@@ -52,7 +53,8 @@ local function initialize_builtin_statbars(player)
        end
 
        if (player:get_breath() < 11) then
-               if player:hud_get_flags().breathbar then
+               if player:hud_get_flags().breathbar and
+                       core.is_yes(core.setting_get("enable_damage")) then
                        if hud_ids[name].id_breathbar == nil then
                                hud_ids[name].id_breathbar = player:hud_add(breath_bar_definition)
                        end