feat(Core/Unit): Implement GetCompanionPet() helper (#20819)
This commit is contained in:
parent
0a66daa005
commit
02cacd2341
2 changed files with 7 additions and 1 deletions
|
|
@ -9028,7 +9028,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
|||
if (!victim)
|
||||
return false;
|
||||
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*this, m_SummonSlot[SUMMON_SLOT_MINIPET]))
|
||||
if (Creature* cr = GetCompanionPet())
|
||||
cr->CastSpell(victim, 50101, true);
|
||||
|
||||
return false;
|
||||
|
|
@ -10663,6 +10663,11 @@ Guardian* Unit::GetGuardianPet() const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Creature* Unit::GetCompanionPet() const
|
||||
{
|
||||
return ObjectAccessor::GetCreature(*this, m_SummonSlot[SUMMON_SLOT_MINIPET]);
|
||||
}
|
||||
|
||||
Unit* Unit::GetCharm() const
|
||||
{
|
||||
if (ObjectGuid charm_guid = GetCharmGUID())
|
||||
|
|
|
|||
|
|
@ -1758,6 +1758,7 @@ public:
|
|||
// Pets, guardians, minions...
|
||||
[[nodiscard]] Guardian* GetGuardianPet() const;
|
||||
[[nodiscard]] Minion* GetFirstMinion() const;
|
||||
[[nodiscard]] Creature* GetCompanionPet() const;
|
||||
|
||||
Pet* CreateTamedPetFrom(Creature* creatureTarget, uint32 spell_id = 0);
|
||||
Pet* CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id = 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue