You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Addon: [1.9.13] Fix FocusTarget bits stale on Vanilla/SoM - TargetFocusTargetGoal never runs
The event-driven BitCache introduced in PR #742 broke the Assist Focus
workflow on Vanilla Classic / Season of Mastery. The GOAP planner would
pick "Follow Focus" (cost 19) instead of "Target Focus Target" (cost 10)
because TargetFocusTargetGoal.CanRun() always evaluated to false.
Root cause: UNIT_FLAGS does not fire for derived/compound unit tokens
like "focustarget" or "party1target". So focusTargetInCombat (bit 6) was
only set when UpdateFocusCache() ran on UNIT_TARGET (target change). If
the mob entered combat after being targeted, the combat flag stayed
false forever until the focus changed target.
Additionally, on Vanilla Classic the "focus" unit token doesn't exist -
the addon maps it to "party1" via DataToColor.C.unitFocus. The
OnUnitTarget_BitCache and OnUnitFlags_BitCache handlers only checked for
the literal "focus" string, missing "party1" entirely.
Finally, PLAYER_FOCUS_CHANGED may not exist on Vanilla Classic, and
using RegisterEvent instead of SafeRegisterEvent could abort subsequent
event registrations in the same block if it errors.
Changes:
BitCache.lua:
- Poll focusTargetInCombat every frame in UpdatePolledValues() since
UNIT_FLAGS never fires for derived unit tokens - this is 1 cheap
UnitAffectingCombat() call per frame, only when focusTargetExists
EventHandlers.lua:
- Add DataToColor.C.unitFocus checks alongside literal "focus" in
OnUnitTarget_BitCache and OnUnitFlags_BitCache so Vanilla "party1"
token is handled correctly
- Same for DataToColor.C.unitFocusTarget alongside "focustarget"
- Use SafeRegisterEvent for PLAYER_FOCUS_CHANGED to prevent errors on
Vanilla Classic from aborting subsequent event registrations
- Register GROUP_ROSTER_UPDATE event with new OnGroupRosterUpdate_BitCache
handler to refresh focus cache when party composition changes
ClassConfiguration.cs:
- On SoM/Vanilla, override TargetFocus.BindingID from TARGETFOCUS to
TARGETPARTYMEMBER1 since Vanilla has no /targetfocus keybind
Addon version bumped 1.9.12 -> 1.9.13
Fixes#788
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments