From 74d88025cbb1568e9359354d3a51f2d3033c7ac0 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 27 Mar 2009 10:13:12 -0600 Subject: *Fix some client issues about pet. --HG-- branch : trunk --- src/game/Pet.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/game/Pet.cpp') diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 71f45507d45..91630eda9a4 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -210,8 +210,6 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool } owner->SetPet(this, true); - AIM_Initialize(); - map->Add((Creature*)this); InitStatsForLevel(petlevel); SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL)); @@ -314,6 +312,9 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool sLog.outDebug("New Pet has guid %u", GetGUIDLow()); + AIM_Initialize(); + map->Add((Creature*)this); + if(owner->GetTypeId() == TYPEID_PLAYER) { ((Player*)owner)->PetSpellInitialize(); @@ -1362,8 +1363,8 @@ bool Pet::learnSpell(uint32 spell_id) WorldPacket data(SMSG_PET_LEARNED_SPELL, 2); data << uint16(spell_id); ((Player*)owner)->GetSession()->SendPacket(&data); + ((Player*)owner)->PetSpellInitialize(); } - ((Player*)owner)->PetSpellInitialize(); } return true; } @@ -1603,7 +1604,8 @@ bool Pet::resetTalents(bool no_cost) m_resetTalentsCost = cost; m_resetTalentsTime = time(NULL); } - player->PetSpellInitialize(); + if(!m_loading) + player->PetSpellInitialize(); return true; } -- cgit v1.2.3