Skip to content

Commit

Permalink
Unit: Add Unit::GetAura const
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Jan 13, 2024
1 parent 56d9cc6 commit 204e707
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5455,6 +5455,14 @@ Aura* Unit::GetAura(uint32 spellId, SpellEffectIndex effindex)
return nullptr;
}

Aura const* Unit::GetAura(uint32 spellId, SpellEffectIndex effindex) const
{
SpellAuraHolderConstBounds bounds = GetSpellAuraHolderBounds(spellId);
if (bounds.first != bounds.second)
return bounds.first->second->GetAuraByEffectIndex(effindex);
return nullptr;
}

Aura* Unit::GetAura(AuraType type, SpellFamily family, uint64 familyFlag, ObjectGuid casterGuid)
{
AuraList const& auras = GetAurasByType(type);
Expand Down
1 change: 1 addition & 0 deletions src/game/Entities/Unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,7 @@ class Unit : public WorldObject
void EvadeTimerExpired();

Aura* GetAura(uint32 spellId, SpellEffectIndex effindex);
Aura const* GetAura(uint32 spellId, SpellEffectIndex effindex) const;
Aura* GetAura(AuraType type, SpellFamily family, uint64 familyFlag, ObjectGuid casterGuid = ObjectGuid());
SpellAuraHolder* GetSpellAuraHolder(uint32 spellid) const;
SpellAuraHolder* GetSpellAuraHolder(uint32 spellid, ObjectGuid casterGuid) const;
Expand Down

0 comments on commit 204e707

Please sign in to comment.