*Cleanups before delete after not successfull load pet from db. Thanks to Drahy for debug traces.
--HG-- branch : trunk
This commit is contained in:
@@ -678,6 +678,7 @@ void WorldSession::HandleUnstablePet( WorldPacket & recv_data )
|
||||
Pet *newpet = new Pet(_player, HUNTER_PET);
|
||||
if(!newpet->LoadPetFromDB(_player,creature_id,petnumber))
|
||||
{
|
||||
newpet->CleanupsBeforeDelete();
|
||||
delete newpet;
|
||||
newpet = NULL;
|
||||
WorldPacket data(SMSG_STABLE_RESULT, 1);
|
||||
@@ -796,6 +797,7 @@ void WorldSession::HandleStableSwapPet( WorldPacket & recv_data )
|
||||
Pet *newpet = new Pet(_player);
|
||||
if(!newpet->LoadPetFromDB(_player,creature_id,pet_number))
|
||||
{
|
||||
newpet->CleanupsBeforeDelete();
|
||||
delete newpet;
|
||||
data << uint8(0x06);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user