Skip to content

Commit

Permalink
Pet/Unit: Add unsummon of guardians on home reach
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Aug 15, 2024
1 parent 88e5d42 commit d0adba7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,18 @@ void Unit::TriggerHomeEvents()
GetMap()->GetCreatureLinkingHolder()->TryFollowMaster((Creature*)this);
}

if (IsCreature() && static_cast<Creature*>(this)->GetCreatureGroup())
static_cast<Creature*>(this)->GetCreatureGroup()->TriggerLinkingEvent(CREATURE_GROUP_EVENT_HOME, this);
if (IsCreature())
{
Creature* me = static_cast<Creature*>(this);
if (me->GetCreatureGroup())
me->GetCreatureGroup()->TriggerLinkingEvent(CREATURE_GROUP_EVENT_HOME, this);
if (me->IsPet())
{
Unit* owner = me->GetOwner();
if (!owner->IsAlive() && static_cast<Pet*>(this)->IsGuardian())
static_cast<Pet*>(this)->Unsummon(PET_SAVE_REAGENTS);
}
}
}

void Unit::EvadeTimerExpired()
Expand Down

0 comments on commit d0adba7

Please sign in to comment.