fix(aura): include the player's pet in the PLAYER filter

Blizzard defines the token as "Include only auras that were cast by the
player, or by the player's pet or vehicle"
(AuraUtil.AuraFilters.Player). There are no vehicles here, so the caster
set is player + pet -- but all three comparisons tested
`casterGuid == PlayerGuid()` and nothing else.

A pet's cast carries the PET's guid in the Aura::Source cache, since
that is who SMSG_SPELL_GO names, so "HARMFUL|PLAYER" silently dropped
every aura the pet applied. `!PLAYER` had the mirror bug: it returned
the pet's auras as though a third party cast them.

Centralize on one IsPlayerOrPetCaster predicate rather than fixing each
site -- IsPlayerCast, GroupIsPlayerCast and CachedMatches had already
grown three separate copies of the comparison, which is how they would
drift again. The pet guid comes from VAR_PET_GUID, a live engine global,
so the predicate stays two compares with no object resolve; it runs per
aura slot. A caster of 0 (cache miss) still matches nothing.

Unrelated and untouched: the `isFromPlayerOrPlayerPet` aura field, which
means "applied by ANY player or a player's pet" and is answered from the
caster's HIGHGUID prefix.

Verified in-game: a Hunter pet's Scorpid Poison now returns from
C_UnitAuras.GetAuraDataByIndex("target", 1, "HARMFUL|PLAYER").
This commit is contained in:
Brues
2026-09-16 23:32:16 -05:00
parent 56d2dbbc27
commit bbefdb847d
4 changed files with 50 additions and 29 deletions
+8 -10
View File
@@ -18563,12 +18563,10 @@ tokens (`"HELPFUL"`, `"HARMFUL"`,
- **`HELPFUL`** (default) / **`HARMFUL`** — pick buffs or debuffs by each
aura's polarity flag. In `GetUnitAuras`, supplying neither returns both.
- **`PLAYER`** — restrict to auras the local player cast, via the
`Aura::Source` caster cache (`sourceGUID == ` player GUID). Combines with
the range tokens (`"HARMFUL|PLAYER"` = your debuffs only). Because the
caster is best-effort, an aura whose cast we didn't observe is treated as
not-player-cast and excluded — so `PLAYER` can under-report auras that
predate login.
- **`PLAYER`** — restrict to auras that the player or the player's pet
cast. Combines with the range tokens (`"HARMFUL|PLAYER"` = your debuffs
only). The caster is known only for casts seen this session, so an aura
that predates login counts as not-player-cast and is excluded.
Other tokens (`RAID` / `CANCELABLE` / `INCLUDE_NAME_PLATE_ONLY`) are
accepted but no-op — they need engine systems (raid-dispel relevance,
@@ -18671,10 +18669,10 @@ leading `!`. This build honors:
- `HELPFUL` / `HARMFUL` — buffs / debuffs, by each aura's polarity flag
rather than its slot number. With neither token the query returns both
(the indexed getter defaults to helpful).
- `PLAYER` / `!PLAYER` — only auras the local player cast, or only
auras the player did not cast. Caster data comes from casts this
session, so an aura present before you saw it cast has no caster and
counts as not-player.
- `PLAYER` / `!PLAYER` — only auras the player or the player's pet cast,
or only the auras neither of them cast. Caster data comes from casts
this session, so an aura present before you saw it cast has no caster
and counts as not-player.
- `DISPELLABLE` / `!DISPELLABLE` — only auras that can be dispelled,
purged, or stolen (dispel type Magic, Curse, Disease, or Poison), or
only auras that cannot. This is "can it be removed at all", not "can