diff --git a/docs/accurate_statbar.patch b/docs/accurate_statbar.patch index 8acf78b17a..657f73e41d 100644 --- a/docs/accurate_statbar.patch +++ b/docs/accurate_statbar.patch @@ -6,13 +6,16 @@ index 46c947b6..f4372843 100644 local hud_ids = {} local function scaleToDefault(player, field) -+ return player["get_" .. field](player) -- -- Scale "hp" or "breath" to the default dimensions -- local current = player["get_" .. field](player) -- local nominal = core["PLAYER_MAX_".. field:upper() .. "_DEFAULT"] -- local max_display = math.max(nominal, -- math.max(player:get_properties()[field .. "_max"], current)) -- return current / max_display * nominal ++ if field == "health" then ++ return player["get_" .. field](player) ++ else + -- Scale "hp" or "breath" to the default dimensions + local current = player["get_" .. field](player) + local nominal = core["PLAYER_MAX_".. field:upper() .. "_DEFAULT"] + local max_display = math.max(nominal, + math.max(player:get_properties()[field .. "_max"], current)) + return current / max_display * nominal ++ end end local function update_builtin_statbars(player)