Skip to content

Commit

Permalink
Don't unsummon pets when mounting
Browse files Browse the repository at this point in the history
  • Loading branch information
Phatcat committed Jun 18, 2016
1 parent 74d3740 commit 1a6fda2
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/game/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8012,15 +8012,8 @@ void Unit::Mount(uint32 mount, uint32 spellId)
((Player*)this)->UnsummonPetTemporaryIfAny();
// Normal case (Unsummon only permanent pet)
else if (Pet* pet = GetPet())
{
if (pet->IsPermanentPetFor((Player*)this) && !((Player*)this)->InArena() &&
sWorld.getConfig(CONFIG_BOOL_PET_UNSUMMON_AT_MOUNT))
{
((Player*)this)->UnsummonPetTemporaryIfAny();
}
else
pet->ApplyModeFlags(PET_MODE_DISABLE_ACTIONS, true);
}
pet->ApplyModeFlags(PET_MODE_DISABLE_ACTIONS, true);

}

float height = ((Player*)this)->GetCollisionHeight(true);
Expand All @@ -8045,17 +8038,17 @@ void Unit::Unmount(bool from_aura)
WorldPacket data(SMSG_DISMOUNT, 8);
data << GetPackGUID();
SendMessageToSet(&data, true);

if (Pet* pet = GetPet())
pet->ApplyModeFlags(PET_MODE_DISABLE_ACTIONS, false);
}

// only resummon old pet if the player is already added to a map
// this prevents adding a pet to a not created map which would otherwise cause a crash
// (it could probably happen when logging in after a previous crash)
if (GetTypeId() == TYPEID_PLAYER)
{
if (Pet* pet = GetPet())
pet->ApplyModeFlags(PET_MODE_DISABLE_ACTIONS, false);
else
((Player*)this)->ResummonPetTemporaryUnSummonedIfAny();
((Player*)this)->ResummonPetTemporaryUnSummonedIfAny();

float height = ((Player*)this)->GetCollisionHeight(false);
if (height)
Expand Down

0 comments on commit 1a6fda2

Please sign in to comment.