mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
- cleaned up some code from my fights with SetTexCoord/nan
This commit is contained in:
@ -697,10 +697,6 @@ function IceBarElement.prototype:SetScale(texture, scale)
|
|||||||
|
|
||||||
self.CurrScale = IceHUD:Clamp(self:LerpScale(scale), 0, 1)
|
self.CurrScale = IceHUD:Clamp(self:LerpScale(scale), 0, 1)
|
||||||
|
|
||||||
if not self.currScale or self.currScale == (1/0) or self.currScale == (0/0) then
|
|
||||||
self.currScale = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
if oldScale ~= self.CurrScale then
|
if oldScale ~= self.CurrScale then
|
||||||
if (self.moduleSettings.side == IceCore.Side.Left) then
|
if (self.moduleSettings.side == IceCore.Side.Left) then
|
||||||
texture:SetTexCoord(1, 0, 1-self.CurrScale, 1)
|
texture:SetTexCoord(1, 0, 1-self.CurrScale, 1)
|
||||||
|
@ -811,7 +811,7 @@ function IceHUD:Clamp(value, min, max)
|
|||||||
value = min
|
value = min
|
||||||
elseif value > max then
|
elseif value > max then
|
||||||
value = max
|
value = max
|
||||||
elseif not (value >= min and value <= max) then
|
elseif value ~= value or not (value >= min and value <= max) then -- check for nan...
|
||||||
value = min
|
value = min
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user