Skip to content

Commit

Permalink
Decrement nominal by 1 for breath bar
Browse files Browse the repository at this point in the history
Co-Authored-By: ClobberXD <ClobberXD@gmail.com>
  • Loading branch information
SmallJoker and ClobberXD committed Feb 25, 2019
1 parent 12f11fe commit 6fc5e47
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions builtin/game/statbars.lua
Expand Up @@ -29,6 +29,10 @@ local function scaleToDefault(player, field)
-- Scale "hp" or "breath" to the default dimensions
local current = player["get_" .. field](player)
local nominal = core["PLAYER_MAX_".. field:upper() .. "_DEFAULT"]
if field == "breath" then
-- Show up/scale to 10 bubbles. Default 11 lets the bar disappear.
nominal = nominal - 1
end
local max_display = math.max(nominal,
math.max(player:get_properties()[field .. "_max"], current))
return current / max_display * nominal
Expand Down

0 comments on commit 6fc5e47

Please sign in to comment.