Skip to content

Commit

Permalink
Fix an issue with timers being 0
Browse files Browse the repository at this point in the history
If a timer occurs being 0, it basically cancels the timer.
Instead, we'll just not update or even start the bar
  • Loading branch information
QartemisT authored Aug 15, 2021
1 parent c478357 commit ea6c2a5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions DBM-PvP/PvPGeneral.lua
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ do
local gameTime = getGametime()
local allyTime = mfloor(mmin(maxScore, (maxScore - allianceScore) / resPerSec[allianceBases + 1]))
local hordeTime = mfloor(mmin(maxScore, (maxScore - hordeScore) / resPerSec[hordeBases + 1]))
if allyTime == hordeTime then
if allyTime == hordeTime or allyTime == 0 or hordeTime == 0 then
winTimer:Stop()
if scoreFrame1Text then
scoreFrame1Text:SetText("")
Expand Down Expand Up @@ -586,7 +586,10 @@ do
capTimer:Stop(infoName)
objectivesStore[infoName] = (atlasName and atlasName or infoTexture)
if not ignoredAtlas[subscribedMapID] and (isAllyCapping or isHordeCapping) then
capTimer:Start(GetAreaPOITimeLeft and GetAreaPOITimeLeft(areaPOIID) and GetAreaPOITimeLeft(areaPOIID) * 60 or overrideTimers[subscribedMapID] or 60, infoName)
local capTime = GetAreaPOITimeLeft and GetAreaPOITimeLeft(areaPOIID) and GetAreaPOITimeLeft(areaPOIID) * 60 or overrideTimers[subscribedMapID] or 60
if capTime ~= 0 then
capTimer:Start(GetAreaPOITimeLeft and GetAreaPOITimeLeft(areaPOIID) and GetAreaPOITimeLeft(areaPOIID) * 60 or overrideTimers[subscribedMapID] or 60, infoName)
end
if isAllyCapping then
capTimer:SetColor({r=0, g=0, b=1}, infoName)
capTimer:UpdateIcon("132486", infoName) -- Interface\\Icons\\INV_BannerPVP_02.blp
Expand Down

0 comments on commit ea6c2a5

Please sign in to comment.