Skip to content

Commit

Permalink
Don't apply healthbar patch to breath
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWolfHT committed Dec 23, 2023
1 parent 57bd373 commit be85dd4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions docs/accurate_statbar.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit be85dd4

Please sign in to comment.