From be85dd4e5c1455c787af75b971122eaccf3aaab4 Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Sat, 23 Dec 2023 14:16:12 -0800 Subject: [PATCH] Don't apply healthbar patch to breath --- docs/accurate_statbar.patch | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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)