diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/PetHandler.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 15dac10688f..42d0093510b 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -161,17 +161,27 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid break; } case COMMAND_ABANDON: // abandon (hunter pet) or dismiss (summoned pet) - if(((Creature*)pet)->isPet()) + if(pet->GetCharmerGUID() == GetPlayer()->GetGUID()) { - Pet* p = (Pet*)pet; - if(p->getPetType() == HUNTER_PET) - _player->RemovePet(p,PET_SAVE_AS_DELETED); - else - //dismissing a summoned pet is like killing them (this prevents returning a soulshard...) - p->setDeathState(CORPSE); + if(GetPlayer()->m_seer != pet) + _player->StopCastingCharm(); + } + else if(pet->GetOwnerGUID() == GetPlayer()->GetGUID()) + { + assert(pet->GetTypeId() == TYPEID_UNIT); + if(((Creature*)pet)->isPet()) + { + if(((Pet*)pet)->getPetType() == HUNTER_PET) + GetPlayer()->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED); + else + //dismissing a summoned pet is like killing them (this prevents returning a soulshard...) + pet->setDeathState(CORPSE); + } + else if(((Creature*)pet)->HasSummonMask(SUMMON_MASK_MINION)) + { + ((Minion*)pet)->UnSummon(); + } } - else // charmed or possessed - _player->StopCastingCharm(); break; default: sLog.outError("WORLD: unknown PET flag Action %i and spellid %i.", flag, spellid); |