Skip to content

Commit

Permalink
Fix disenchant value from hidden reasons being used
Browse files Browse the repository at this point in the history
  • Loading branch information
evil-morfar committed Nov 4, 2024
1 parent d3b3ec4 commit 8d07d42
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Modules/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion Modules/votingFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8d07d42

Please sign in to comment.