Skip to content

Commit b764b14

Browse files
committed
Filter hidden auras in cache fallback path
Add visibility check to `FallbackEligible` to prevent hidden/internal auras (e.g. SPELL_ATTR_HIDDEN_CLIENTSIDE) from leaking through as phantom buffs. The descriptor path already drops these via `IsSlotPopulated`; the cache fallback must apply the same engine predicate to avoid surfacing invisible auras.
1 parent fc1bd30 commit b764b14

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/aura/Data.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,12 +515,18 @@ int CountSlots(const uint8_t *unit, Filter filter, bool playerOnly) {
515515
constexpr int kFallbackMax = Offsets::UNIT_AURA_TOTAL;
516516

517517
// Whether cache entry `c` should be surfaced as a fallback for `unit` under
518-
// `filter`/`playerOnly`: it must not already be in a populated descriptor slot
519-
// (no double-listing the same live aura) and, when player-filtered, must have
520-
// been cast by us. Superseded / dispelled auras are kept out of the cache by
521-
// `Aura::Source`'s removal eviction, not filtered here.
518+
// `filter`/`playerOnly`: the spell must be a user-visible aura, it must not
519+
// already be in a populated descriptor slot (no double-listing the same live
520+
// aura) and, when player-filtered, must have been cast by us. Superseded /
521+
// dispelled auras are kept out of the cache by `Aura::Source`'s removal
522+
// eviction, not filtered here.
522523
bool FallbackEligible(const uint8_t *unit, const Aura::Source::CachedAura &c,
523524
Filter filter, bool playerOnly) {
525+
if (!IsVisible(SpellRecord(c.spellId)))
526+
return false; // hidden/internal aura (e.g. SPELL_ATTR_HIDDEN_CLIENTSIDE):
527+
// the descriptor path drops these via IsSlotPopulated, so
528+
// the cache path must apply the same engine predicate or
529+
// they leak through as tooltip-less phantom buffs.
524530
if (FindSlotBySpellID(unit, c.spellId, &filter, false) >= 0)
525531
return false; // still in the descriptor — returned via the slot path
526532
if (playerOnly && c.casterGuid != Unit::Identity::PlayerGuid())

0 commit comments

Comments
 (0)