Quantcast

Add check to see if timer is already active.(ticket 6+)

Erik L. Vonderscheer [01-26-11 - 22:06]
Add check to see if timer is already active.(ticket 6+)
Filename
TradeFilter3.lua
diff --git a/TradeFilter3.lua b/TradeFilter3.lua
index 5a323b3..6217e9f 100644
--- a/TradeFilter3.lua
+++ b/TradeFilter3.lua
@@ -275,7 +275,9 @@ function TF3:GetParty(arg)
 					if (TF3.db.profile.debug) then
 						TF3:FindFrame(debugFrame, "|cFFFFFF80" .. L["MIPM"] .. "|r")
 					end
-					self:ScheduleTimer("GetParty", 10, "raid")
+					if not (self:TimeLeft(self.RaidTimer)) then
+						self.RaidTimer = self:ScheduleTimer("GetParty", 10, "raid")
+					end
 					break
 				end
 			end
@@ -283,6 +285,7 @@ function TF3:GetParty(arg)
 			if (TF3.db.profile.debug) then
 				TF3:FindFrame(debugFrame, "|cFFFFFF80" .. L["Wiping party exempt list"] .. "|r")
 			end
+			self:CancelAllTimers()
 			TF3:WipeTable(currentParty)
 		end
 	end
@@ -301,7 +304,9 @@ function TF3:GetParty(arg)
 					if (TF3.db.profile.debug) then
 						TF3:FindFrame(debugFrame, "|cFFFFFF80" .. L["MIPM"] .. "|r")
 					end
-					self:ScheduleTimer("GetParty", 10, "party")
+					if not (self:TimeLeft(self.PartyTimer)) then
+						self.PartyTimer = self:ScheduleTimer("GetParty", 10, "party")
+					end
 					break
 				end
 			end
@@ -309,6 +314,7 @@ function TF3:GetParty(arg)
 			if (TF3.db.profile.debug) then
 				TF3:FindFrame(debugFrame, "|cFFFFFF80" .. L["Wiping party exempt list"] .. "|r")
 			end
+			self:CancelAllTimers()
 			TF3:WipeTable(currentParty)
 		end
 	end