From 3eb13d1f718728c5d92f169c4ddfd9bf61d42d73 Mon Sep 17 00:00:00 2001 From: Jesse Manelius Date: Mon, 28 Jan 2019 18:09:56 +0200 Subject: [PATCH] fix dungeon check for new weekly best runs add "/iks c x" slash cmd in case addon missed your weekly run for some reason and wow api doesn't return anything (chances for that are currently high) --- iKeystones.lua | 23 ++++++++++++++++------- iKeystones.toc | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/iKeystones.lua b/iKeystones.lua index 84d96a5..b24c900 100644 --- a/iKeystones.lua +++ b/iKeystones.lua @@ -271,15 +271,17 @@ end --end local validDungeons local function IsValidDungeon(dungeonID) + dungeonID = tonumber(dungeonID) + if not dungeonID then return end if not validDungeons then + validDungeons = {} C_MythicPlus.RequestMapInfo() - validDungeons = C_ChallengeMode.GetMapTable() - end - if validDungeons[dungeonID] then - return true - else - return false + local t = C_ChallengeMode.GetMapTable() + for _,v in pairs(t) do + validDungeons[v] = true + end end + return validDungeons[dungeonID] end function iKS:scanCharacterMaps() if not iKS:createPlayer() then return end @@ -459,7 +461,7 @@ function addon:PLAYER_LOGIN() player = UnitGUID('player') C_MythicPlus.RequestCurrentAffixes() C_MythicPlus.RequestMapInfo() - C_MythicPlus.RequestRewards() + C_MythicPlus.RequestRewards() GarrisonLandingPageMinimapButton:HookScript('OnEnter', function() if IsShiftKeyDown() then iKS:createMainWindow() @@ -1047,6 +1049,13 @@ SlashCmdList["IKEYSTONES"] = function(msg) print('iKS: This character is now whitelisted.') elseif msg == 'help' or msg == 'h' then iKS:help() + elseif msg:match('^completed (%d+)$') or msg:match('^c (%d+)$') then + local level = msg:match('^completed (%d+)$') + if not level then + level = msg:match('^c (%d+)$') + end + if not iKS:createPlayer() then return end + iKeystonesDB[player].maxCompleted = tonumber(level) elseif msg:match('delete') or msg:match('d') then local _,char,server = msg:match("^(.-) (.-) (.*)$") if not (char and server) then diff --git a/iKeystones.toc b/iKeystones.toc index 3850952..a3e677b 100644 --- a/iKeystones.toc +++ b/iKeystones.toc @@ -2,7 +2,7 @@ ## Title: iKeystones ## Notes: Tracks your keystones ## Author: Ironi -## Version: 1.720 +## Version: 1.721 ## DefaultState: enabled ## SavedVariables: iKeystonesDB, iKeystonesConfig -- 1.7.9.5