Temporarily set default biome in builtin
[oweals/minetest.git] / builtin / game / statbars.lua
index 9e5699314af38162e6a229c9ef6a107ece0a4c81..c0d49332f8896b3b99bbafc4a6e877b1b75b4171 100644 (file)
@@ -37,9 +37,13 @@ local function initialize_builtin_statbars(player)
 
        if (hud_ids[name] == nil) then
                hud_ids[name] = {}
+               -- flags are not transmitted to client on connect, we need to make sure
+               -- our current flags are transmitted by sending them actively
+               player:hud_set_flags(player:hud_get_flags())
        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 +56,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