diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Pet.cpp | 9 | ||||
-rw-r--r-- | src/game/Player.cpp | 7 |
2 files changed, 6 insertions, 10 deletions
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 4d87a224f7e..86f0ec58db5 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -477,11 +477,7 @@ void Pet::setDeathState(DeathState s) // overwrite virtual Creature::setDeathState(s); if(getDeathState()==CORPSE) { - //remove summoned pet (no corpse) - if(getPetType()==SUMMON_PET) - Remove(PET_SAVE_NOT_IN_SLOT); - // other will despawn at corpse desppawning (Pet::Update code) - else + if(getPetType() == HUNTER_PET) { // pet corpse non lootable and non skinnable SetUInt32Value( UNIT_DYNAMIC_FLAGS, 0x00 ); @@ -511,9 +507,8 @@ void Pet::Update(uint32 diff) { case CORPSE: { - if( m_deathTimer <= diff ) + if(getPetType() != HUNTER_PET || m_deathTimer <= diff ) { - assert(getPetType()!=SUMMON_PET && "Must be already removed."); Remove(PET_SAVE_NOT_IN_SLOT); //hunters' pets never get removed because of death, NEVER! return; } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 1779ea84d7c..2d7d98579a8 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -16454,18 +16454,19 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent) } } - pet->SavePetToDB(mode); - // only if current pet in slot switch(pet->getPetType()) { case POSSESSED_PET: pet->RemoveCharmedOrPossessedBy(NULL); + break; default: - SetGuardian(pet, false); + pet->SavePetToDB(mode); break; } + SetGuardian(pet, false); + pet->CleanupsBeforeDelete(); pet->AddObjectToRemoveList(); pet->m_removed = true; |