From 02b51fb9769ca5fe9c4c1f2cf4a8f3e9a7b337d4 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Thu, 30 Sep 2010 17:48:01 +0400 Subject: [PATCH] [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. --- src/game/Player.cpp | 9 +-------- src/game/Player.h | 1 - src/shared/revision_nr.h | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 86214759d..fd9690a6e 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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); } diff --git a/src/game/Player.h b/src/game/Player.h index 169d1e759..4a9240e51 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2691,7 +2691,6 @@ class MANGOS_DLL_SPEC Player : public Unit // Temporary removed pet cache uint32 m_temporaryUnsummonedPetNumber; - uint32 m_oldpetspell; AchievementMgr m_achievementMgr; ReputationMgr m_reputationMgr; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 34c48a4b7..e2a402bad 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10559" + #define REVISION_NR "10560" #endif // __REVISION_NR_H__