From 62874d8204fc045b839ea923e158c786cf9d0ec2 Mon Sep 17 00:00:00 2001 From: "vjekoslav.krenek@gmail.com" <313787825+svart2521@users.noreply.github.com> Date: Sun, 13 Sep 2026 04:37:05 +0200 Subject: [PATCH] Fix: enchanting one weapon hides both weapon-enchant reminders Bug: Applying a temporary weapon enchant (oil) to the off-hand weapon made the main-hand reminder disappear too, even though the main hand still had no enchant. Removing the off-hand's enchant brought both reminders back. Issue: EmitWeaponEnchantReminders (EllesmereUIAuraBuffReminders.lua) picked each hand's "has enchant" state with the "cond and a or b" idiom: local has = (i == 1) and hasMH or hasOH This idiom silently falls through to b whenever a is falsy. For the main hand (i == 1), whenever hasMH was false (no enchant), the expression evaluated to hasOH instead -- so an unenchanted main hand was read as having the off hand's enchant state. With the off hand freshly enchanted, the main hand's reminder was wrongly suppressed as "not needed yet". The off hand's own slot was unaffected (its branch never depended on a falsy value to pick the right side), which is why enchanting main hand first never showed the bug. Fix: Replaced the idiom with a plain if/else that assigns the correct values unconditionally, per slot. Compiles clean (luac5.1 -p). Confirmed live: enchanting only the off hand now correctly leaves the main hand's reminder visible. --- .../EllesmereUIAuraBuffReminders.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/EllesmereUIAuraBuffReminders/EllesmereUIAuraBuffReminders.lua b/EllesmereUIAuraBuffReminders/EllesmereUIAuraBuffReminders.lua index 997d7deb4..937c38546 100644 --- a/EllesmereUIAuraBuffReminders/EllesmereUIAuraBuffReminders.lua +++ b/EllesmereUIAuraBuffReminders/EllesmereUIAuraBuffReminders.lua @@ -3482,9 +3482,11 @@ end function EABR.EmitWeaponEnchantReminders(missing, co) local hasMH, mhExpire, _, _, hasOH, ohExpire = EABR.WeaponEnchants() for i = 1, 2 do - local slot = (i == 1) and 16 or 17 - local has = (i == 1) and hasMH or hasOH - local expire = (i == 1) and mhExpire or ohExpire + local slot, has, expire + -- Plain if/else, not "cond and a or b": that idiom silently falls + -- through to b whenever a (hasMH) is false, corrupting slot 16. + if i == 1 then slot, has, expire = 16, hasMH, mhExpire + else slot, has, expire = 17, hasOH, ohExpire end local r = EABR._resolved.we[slot] local cat = r.cat local shouldRemind = false