diff options
author | megamage <none@none> | 2009-04-02 19:05:17 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-04-02 19:05:17 -0600 |
commit | 8e0a0877e17af1d62953d418eea0a3b6e1ac672a (patch) | |
tree | e7d49df8837378cfd28585b3a4a95cd27f234ac6 /src | |
parent | bd6974abcdf12894cc9f9c8951c8be451fe5c9e3 (diff) |
*Try to fix the bug that pet cause client crash.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Pet.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 58ed8d678e4..af20e1c579c 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -184,9 +184,6 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool SetUInt32Value(UNIT_NPC_FLAGS, 0); SetName(fields[9].GetString()); - map->Add((Creature*)this); - owner->SetGuardian(this, true); - switch(getPetType()) { case SUMMON_PET: @@ -212,7 +209,6 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool sLog.outError("Pet have incorrect type (%u) for pet loading.", getPetType()); } - InitStatsForLevel(petlevel); SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL)); SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, fields[5].GetUInt32()); SetCreatorGUID(owner->GetGUID()); @@ -222,6 +218,11 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool uint32 savedhealth = fields[11].GetUInt32(); uint32 savedmana = fields[12].GetUInt32(); + map->Add((Creature*)this); + owner->SetGuardian(this, true); + + InitStatsForLevel(petlevel); + // set current pet as current if(fields[8].GetUInt32() != 0) { @@ -281,7 +282,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool } // since last save (in seconds) - uint32 timediff = (time(NULL) - fields[16].GetUInt32()); + //uint32 timediff = (time(NULL) - fields[16].GetUInt32()); m_resetTalentsCost = fields[17].GetUInt32(); m_resetTalentsTime = fields[18].GetUInt64(); |