- added tons of divide-by-zero protection all over the place

- general cleanup of values passed to UpdateBar
This commit is contained in:
Parnic
2009-04-18 21:07:42 +00:00
parent f11192bfd1
commit 10af4566d6
16 changed files with 24 additions and 19 deletions

View File

@ -191,9 +191,9 @@ function HungerForBlood.prototype:UpdateHungerForBlood(unit, fromUpdate)
remaining = hfbEndTime - now
end
if (hfbBuffCount ~= nil and hfbBuffCount > 2) then
self:UpdateBar(remaining / hfbDuration, "HungerForBloodMax")
self:UpdateBar(hfbDuration > 0 and remaining / hfbDuration or 0, "HungerForBloodMax")
else
self:UpdateBar(remaining / hfbDuration, "HungerForBlood")
self:UpdateBar(hfbDuration > 0 and remaining / hfbDuration or 0, "HungerForBlood")
end
formatString = self.moduleSettings.upperText or ''