From 269613a2fc626df8ce0b7f9e5841bf036e465a51 Mon Sep 17 00:00:00 2001 From: John Pasula Date: Thu, 4 Mar 2010 14:35:31 -0700 Subject: [PATCH] Add some throttling to the rep updates. Number pulled out of my ass is 10. --- ARL.lua | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/ARL.lua b/ARL.lua index b7646d0..64324f1 100644 --- a/ARL.lua +++ b/ARL.lua @@ -745,9 +745,22 @@ function addon:MERCHANT_SHOW() addon:ScanVendor() end ----Event used to update the internal faction database when your faction changes. -function addon:UPDATE_FACTION() - Player:SetReputationLevels() +do + + -- We don't want to update the reputation with every kill, lets keep track of how many we've done + -- and only do it every 10th update. + local factionincrement = 0 + + ---Event used to update the internal faction database when your faction changes. + function addon:UPDATE_FACTION() + -- Increment the faction counter + factionincrement = factionincrement + 1 + -- Only update the rep levels on every 10th event firing. + if (factionincrement % 10) then + Player:SetReputationLevels() + end + end + end do -- 1.7.9.5