Skip to content

Nameplates: let the tank has-aggro color reach bosses that have mana - #1995

Open
dfrisone wants to merge 1 commit into
EllesmereGaming:mainfrom
dfrisone:fix/nameplate-threat-color-caster
Open

Nameplates: let the tank has-aggro color reach bosses that have mana#1995
dfrisone wants to merge 1 commit into
EllesmereGaming:mainfrom
dfrisone:fix/nameplate-threat-color-caster

Conversation

@dfrisone

@dfrisone dfrisone commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

A tank holding a boss saw the boss stay on the Spell Casters color instead of the Tank "Has Aggro" color, and no combination of settings could change it.

GetReactionColor resolves in numbered priority steps. Step 6b promotes has-aggro above the mini-boss/caster colors and deliberately excludes boss units, with a comment saying why: bosses are meant to be governed by "Override Boss colors" at step 9. But step 8 returns the caster color unconditionally, and it sits between the two.

"Caster" is UnitHasPowerType(unit, Enum.PowerType.Mana), so it covers every boss carrying a mana pool, not just mobs that cast. For those bosses step 8 always returned first and step 9 was unreachable, which means "Override Boss colors" has never done anything for them despite defaulting on.

Step 8 now defers when step 9 will claim the unit. The new guard tests the same two settings step 9 tests, so a profile with Tank Has Aggro off takes the old path unchanged. That setting defaults off, so default profiles see no difference.

How was it tested?

Reported by @Tomfoolery against Coiled Altar Malacrass: the plate stayed on the caster color while actively tanking, and the same profile colored correctly on mobs without mana. Fix confirmed in game on live by the reporter.

Also checked: losing threat still goes to no-aggro, off-tank coloring is unaffected, and turning Tank Has Aggro off reproduces the previous behavior exactly.

Non-boss casters are unchanged by design. Those are governed by "Override Mini-Boss and Caster colors", which works as documented.

Screenshots

Not included. The change moves one existing color between two existing swatches, both already user-configurable, so a screenshot shows a boss plate in whichever two colors that profile has set. Happy to add a before/after if review wants one.

Checklist

  • New settings default OFF (no behavior change without opt-in) -- N/A, no new settings; gated behind the existing Tank Has Aggro, which defaults off
  • Zero cost while disabled: no events registered, no polling, no hooks doing work, no frames built
  • Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations) -- two locals and two table reads, only on a plate that is a boss while you are a tank holding it
  • No writes onto Blizzard-owned frames (weak-table pattern used); HookScript/hooksecurefunc only, never SetScript on Blizzard frames -- N/A, no frame code touched
  • Tested in-game on live; no version gates or pre-Midnight APIs added

The caster step returns before the tank has-aggro step, and "caster" is just
whether the unit has a mana pool. Step 6b already defers boss units to step 9
on purpose, so that a boss is governed by "Override Boss colors" -- but the
caster return sits between the two and fires first for any boss carrying mana.
The option defaults on and has never been able to reach one.

Reported on Coiled Altar Malacrass, whose plate stayed on the caster color
while the tank held it; the same profile colors correctly on mobs without mana.

Step 8 now defers when step 9 will claim the unit, testing the same two
settings step 9 tests, so a profile with the feature off takes the old path
unchanged. Tank Has Aggro defaults off, so default profiles are unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant