From 8d07d424d595fdf00b18fe8960f91b7fbf29163b Mon Sep 17 00:00:00 2001 From: evil_morfar <10189576+evil-morfar@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:02:41 +0100 Subject: [PATCH] Fix disenchant value from hidden reasons being used --- Modules/options.lua | 12 ++++++++++++ Modules/votingFrame.lua | 3 ++- changelog.md | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Modules/options.lua b/Modules/options.lua index e241d6fc..2e9426bf 100644 --- a/Modules/options.lua +++ b/Modules/options.lua @@ -1396,6 +1396,18 @@ function addon:OptionsTable() min = 1, max = self.db.profile.maxAwardReasons, step = 1, + set = function (info, val) + addon.db.profile[info[#info]] = val + -- Update disenchant - especially if we just hid the only disenachant reason + addon.db.profile.disenchant = false + for i = 1, self.db.profile.numAwardReasons do + if self.db.profile.awardReasons[i].disenchant then + addon.db.profile.disenchant = true + break + end + end + addon:ConfigTableChanged(info[#info]) + end }, -- Award reasons made further down reset = { diff --git a/Modules/votingFrame.lua b/Modules/votingFrame.lua index d539eb6b..b134ab8f 100644 --- a/Modules/votingFrame.lua +++ b/Modules/votingFrame.lua @@ -2366,7 +2366,8 @@ do info.text = "|cff"..addon.Utils:RGBToHex(c.r, c.g, c.b)..addon.Ambiguate(name).."|r "..tostring(player.enchantingLvl) info.notCheckable = true info.func = function() - for _,v1 in ipairs(db.awardReasons) do + for k,v1 in ipairs(db.awardReasons) do + if k > db.numAwardReasons then break end if v1.disenchant then local data = lootTable[session].candidates[name] -- Shorthand LibDialog:Spawn("RCLOOTCOUNCIL_CONFIRM_AWARD", RCVotingFrame:GetAwardPopupData(session, name, data, v1)) diff --git a/changelog.md b/changelog.md index 95977e3f..b7949ac7 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,7 @@ - *Fixed Group Leader chat command help not being printed without having other modules enabled (Curse#546).* - *Moving a frame the exact moment it's minimized will no longer make it stuck to the mouse.* +- *Clicking the "Disenchant" button in the voting frame could use values from hidden award reasons.* # 3.14.3