Fix incorrect mana alpha when max mana is 0

This commit is contained in:
Parnic
2021-03-21 11:18:58 -05:00
parent f6c737c654
commit 354fb483bb
2 changed files with 9 additions and 1 deletions

View File

@ -243,7 +243,14 @@ function IceUnitBar.prototype:Update()
self.mana = IceHUD:MathRound(self.mana / 100)
self.maxMana = IceHUD:MathRound(self.maxMana / 100)
end
self.manaPercentage = self.maxMana ~= 0 and (self.mana/self.maxMana) or 0
-- account for cases where maxMana is 0, perhaps briefly (during certain spells, for example)
-- and properly handle it as full. this allows for proper alpha handling during these times.
if self.maxMana == self.mana then
self.manaPercentage = 1
else
self.manaPercentage = self.maxMana ~= 0 and (self.mana/self.maxMana) or 0
end
local locClass
locClass, self.unitClass = UnitClass(self.unit)

View File

@ -3,6 +3,7 @@
vNext:
- Activated Totems module for all classes in Shadowlands. Some class abilities spawn units that live for a specific amount of time, and the game handles these as Totems.
- Fixed an issue where mana bars could use the wrong alpha settings if the player's maximum mana was 0 (such as during the use of Soulshape).
v1.13.2: