Quantcast

FIXED: Achievements should no longer behave weird after a threshold change.

F16Gaming [12-12-11 - 18:31]
FIXED: Achievements should no longer behave weird after a threshold change.
Filename
KillTrack.lua
diff --git a/KillTrack.lua b/KillTrack.lua
index d8d670e..fd91a23 100644
--- a/KillTrack.lua
+++ b/KillTrack.lua
@@ -102,6 +102,7 @@ function KT:SetThreshold(threshold)
 		error("KillTrack.SetThreshold: Argument #1 (threshold) must be of type 'number'")
 	end
 	self.Global.ACHIEV_THRESHOLD = threshold
+	self:ResetAchievCount()
 	KT:Msg(("New kill notice (achievement) threshold set to %d."):format(threshold))
 end

@@ -291,6 +292,12 @@ function KT:Reset()
 	StaticPopup_Show("KILLTRACK_FINISH", tostring(count))
 end

+function KT:ResetAchievCount()
+	for _,v in pairs(self.Global.MOBS) do
+		v.AchievCount = floor(v.Kills / self.Global.ACHIEV_THRESHOLD)
+	end
+end
+
 KT.Frame = CreateFrame("Frame")

 for k,_ in pairs(KT.Events) do