From ea6c2a533554b40c0ebe54fe5daa187c3a8a29d2 Mon Sep 17 00:00:00 2001 From: Artemis Date: Sun, 15 Aug 2021 05:10:49 +0100 Subject: [PATCH] Fix an issue with timers being 0 If a timer occurs being 0, it basically cancels the timer. Instead, we'll just not update or even start the bar --- DBM-PvP/PvPGeneral.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/DBM-PvP/PvPGeneral.lua b/DBM-PvP/PvPGeneral.lua index e1e629f..e907159 100644 --- a/DBM-PvP/PvPGeneral.lua +++ b/DBM-PvP/PvPGeneral.lua @@ -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("") @@ -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