From 09c3c3ba9f5daeb82006a874ca9361a68ccb906e Mon Sep 17 00:00:00 2001 From: Tim Stirrat Date: Fri, 6 Oct 2023 10:02:47 +1000 Subject: [PATCH 1/3] Fix classic era Classic era returns nil or "" for GetDifficultyInfo so we needed more checking on the diffname diffid --- Config.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Config.lua b/Config.lua index b3179a6..0ba26e9 100644 --- a/Config.lua +++ b/Config.lua @@ -51,6 +51,7 @@ local GetBindingAction = GetBindingAction local GetBindingText = GetBindingText local SetBindings = SetBindings local GetCurrentBindingSet = GetCurrentBindingSet +local GetDifficultyInfo = GetDifficultyInfo local SaveBindings = SaveBindings or AttemptToSaveBindings local KEY_BOUND = KEY_BOUND @@ -1109,8 +1110,8 @@ function mod:GetZoneName(zone) simple = self:SimplifyName(zone) local inInstance, type = IsInInstance() - local diffid, diffname, heroic = mod:GetDifficultyInfo() - if inInstance and (diffid <= 0 or not heroic) and diffname ~= "10 Player" and diffname ~= "25 Player" then + local diffid, diffname, heroic = GetDifficultyInfo() + if inInstance and diffid and (diffid <= 0 or not heroic) and diffname and (diffname ~= "10 Player" and diffname ~= "25 Player") then simple = simple .. diffname end local isRaid = type == "raid" From ce6e00db83e260505fe885ace86852cd030f078c Mon Sep 17 00:00:00 2001 From: Tim Stirrat Date: Fri, 6 Oct 2023 10:05:17 +1000 Subject: [PATCH 2/3] bump toc --- MagicMarker.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MagicMarker.toc b/MagicMarker.toc index 0fe5426..3ff9ed3 100644 --- a/MagicMarker.toc +++ b/MagicMarker.toc @@ -1,5 +1,5 @@ ## Interface: 100002 -## Interface-Classic: 11403 +## Interface-Classic: 11404 ## Interface-BCC: 20504 ## Interface-Wrath: 30400 ## X-Curse-Project-ID: 14363 From aab9d0ea4d5c43dfb3c23d7cc60fa3766b93113f Mon Sep 17 00:00:00 2001 From: Tim Stirrat Date: Sat, 7 Oct 2023 10:14:03 +1000 Subject: [PATCH 3/3] Better fix, edit mod:GetDifficultyInfo --- Config.lua | 5 ++--- MagicMarker.lua | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Config.lua b/Config.lua index 0ba26e9..b3179a6 100644 --- a/Config.lua +++ b/Config.lua @@ -51,7 +51,6 @@ local GetBindingAction = GetBindingAction local GetBindingText = GetBindingText local SetBindings = SetBindings local GetCurrentBindingSet = GetCurrentBindingSet -local GetDifficultyInfo = GetDifficultyInfo local SaveBindings = SaveBindings or AttemptToSaveBindings local KEY_BOUND = KEY_BOUND @@ -1110,8 +1109,8 @@ function mod:GetZoneName(zone) simple = self:SimplifyName(zone) local inInstance, type = IsInInstance() - local diffid, diffname, heroic = GetDifficultyInfo() - if inInstance and diffid and (diffid <= 0 or not heroic) and diffname and (diffname ~= "10 Player" and diffname ~= "25 Player") then + local diffid, diffname, heroic = mod:GetDifficultyInfo() + if inInstance and (diffid <= 0 or not heroic) and diffname ~= "10 Player" and diffname ~= "25 Player" then simple = simple .. diffname end local isRaid = type == "raid" diff --git a/MagicMarker.lua b/MagicMarker.lua index 2aaf659..4dcf645 100644 --- a/MagicMarker.lua +++ b/MagicMarker.lua @@ -198,7 +198,10 @@ function mod:GetDifficultyInfo() local _,instype, diffid, diffname = GetInstanceInfo() if instype ~= "none" and diffid and diffid > 0 then local name, _, heroic = GetDifficultyInfo(diffid) - return diffid, name, heroic + -- Classic Era has GetDifficultyInfo but it returns nothing + if name then + return diffid, name, heroic + end end end return 0, "Normal", false