Quantcast

Avoid leaking weekly best data from another char (wtf??, how is this even possible)

Jesse Manelius [01-23-19 - 02:32]
Avoid leaking weekly best data from another char (wtf??, how is this even possible)
fix reaping messing up with weekly resets
Filename
iKeystones.lua
iKeystones.toc
diff --git a/iKeystones.lua b/iKeystones.lua
index 7107e68..84d96a5 100644
--- a/iKeystones.lua
+++ b/iKeystones.lua
@@ -31,6 +31,7 @@ iKS.currentMax = 0
 iKS.frames = {}
 local shouldBeCorrectInfoForWeekly = false
 local player = UnitGUID('player')
+local unitName = UnitName('player')

 iKS.apFromDungeons = {
 	[1] = { -- Lesser
@@ -120,6 +121,7 @@ local sortedAffixes = {

 	--[15] = ?, --Relentless
 	[16] = 4, --Infested
+	[117] = 4, --Reaping
 }

 iKS.affixCycles = {
@@ -284,9 +286,16 @@ function iKS:scanCharacterMaps()
 	local maps = C_ChallengeMode.GetMapTable()
 	local maxCompleted = 0
 	for _, mapID in pairs(maps) do
-		local _, level, _, affixes = C_MythicPlus.GetWeeklyBestForMap(mapID)
-		if level and level > maxCompleted then
-			maxCompleted = level
+		local _, level, _, affixes, members = C_MythicPlus.GetWeeklyBestForMap(mapID)
+		if members then
+			for _,member in pairs(members) do -- Avoid leaking from another char (wtf??, how is this even possible)
+				if member.name == unitName then
+					if level and level > maxCompleted then
+						maxCompleted = level
+					end
+					break;
+				end
+			end
 		end
 	end
 	if iKeystonesDB[player].maxCompleted and iKeystonesDB[player].maxCompleted < maxCompleted then
diff --git a/iKeystones.toc b/iKeystones.toc
index 2f90fe7..3850952 100644
--- a/iKeystones.toc
+++ b/iKeystones.toc
@@ -2,7 +2,7 @@
 ## Title: iKeystones
 ## Notes: Tracks your keystones
 ## Author: Ironi
-## Version: 1.715
+## Version: 1.720
 ## DefaultState: enabled

 ## SavedVariables: iKeystonesDB, iKeystonesConfig