mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 14:50:13 -05:00
Fix incorrect mana alpha when max mana is 0
This commit is contained in:
@ -243,7 +243,14 @@ function IceUnitBar.prototype:Update()
|
|||||||
self.mana = IceHUD:MathRound(self.mana / 100)
|
self.mana = IceHUD:MathRound(self.mana / 100)
|
||||||
self.maxMana = IceHUD:MathRound(self.maxMana / 100)
|
self.maxMana = IceHUD:MathRound(self.maxMana / 100)
|
||||||
end
|
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
|
local locClass
|
||||||
locClass, self.unitClass = UnitClass(self.unit)
|
locClass, self.unitClass = UnitClass(self.unit)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
vNext:
|
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.
|
- 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:
|
v1.13.2:
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user