diff options
author | QAston <none@none> | 2010-01-18 23:12:35 +0100 |
---|---|---|
committer | QAston <none@none> | 2010-01-18 23:12:35 +0100 |
commit | a1bbbd1421d29edd02feb2e19df8b07c9484f59d (patch) | |
tree | 7a64117ff17d3c44a0677ca05256366044c3ca3c /src/game/Object.cpp | |
parent | c7c3b0edb06abbbbf5ffc54ed9e499a04e62c645 (diff) |
*Cleanups before delete after not successfull load pet from db. Thanks to Drahy for debug traces.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r-- | src/game/Object.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 28c50a9e38e..104fb26e99f 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1828,6 +1828,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy // petentry==0 for hunter "call pet" (current pet summoned if any) if(!entry) { + pet->CleanupsBeforeDelete(); delete pet; return NULL; } @@ -1836,6 +1837,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy if(!pet->IsPositionValid()) { sLog.outError("ERROR: Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)",pet->GetGUIDLow(),pet->GetEntry(),pet->GetPositionX(),pet->GetPositionY()); + pet->CleanupsBeforeDelete(); delete pet; return NULL; } @@ -1845,6 +1847,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy if(!pet->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number)) { sLog.outError("no such creature entry %u", entry); + pet->CleanupsBeforeDelete(); delete pet; return NULL; } |