[10560] Remove reundenant spell store for temporary unsummoned pet.

We not use this data and now always have proeprtly save current pet
when it temporary unsummoned and avoid it overwrite by another cases.
This commit is contained in:
VladimirMangos 2010-09-30 17:48:01 +04:00
parent bc04ae4b4c
commit 02b51fb976
3 changed files with 2 additions and 10 deletions

View file

@ -525,10 +525,6 @@ Player::Player (WorldSession *session): Unit(), m_mover(this), m_camera(this), m
m_ammoDPS = 0.0f;
m_temporaryUnsummonedPetNumber = 0;
//cache for UNIT_CREATED_BY_SPELL to allow
//returning reagents for temporarily removed pets
//when dying/logging out
m_oldpetspell = 0;
////////////////////Rest System/////////////////////
time_inn_enter=0;
@ -17644,7 +17640,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
if (returnreagent && pet && mode != PET_SAVE_AS_CURRENT)
{
//returning of reagents only for players, so best done here
uint32 spellId = pet ? pet->GetUInt32Value(UNIT_CREATED_BY_SPELL) : m_oldpetspell;
uint32 spellId = pet->GetUInt32Value(UNIT_CREATED_BY_SPELL);
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
if(spellInfo)
@ -21637,10 +21633,7 @@ void Player::UnsummonPetTemporaryIfAny()
return;
if(!m_temporaryUnsummonedPetNumber && pet->isControlled() && !pet->isTemporarySummoned() )
{
m_temporaryUnsummonedPetNumber = pet->GetCharmInfo()->GetPetNumber();
m_oldpetspell = pet->GetUInt32Value(UNIT_CREATED_BY_SPELL);
}
RemovePet(pet, PET_SAVE_AS_CURRENT);
}