*Cleanups before delete after not successfull load pet from db. Thanks to Drahy for debug traces.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-01-18 23:12:35 +01:00
parent c7c3b0edb0
commit a1bbbd1421
4 changed files with 14 additions and 0 deletions

View File

@@ -16462,7 +16462,10 @@ void Player::LoadPet()
{
Pet *pet = new Pet(this);
if (!pet->LoadPetFromDB(this,0,0,true))
{
pet->CleanupsBeforeDelete();
delete pet;
}
}
}
@@ -22455,7 +22458,10 @@ void Player::ResummonPetTemporaryUnSummonedIfAny()
Pet* NewPet = new Pet(this);
if(!NewPet->LoadPetFromDB(this, 0, m_temporaryUnsummonedPetNumber, true))
{
NewPet->CleanupsBeforeDelete();
delete NewPet;
}
m_temporaryUnsummonedPetNumber = 0;
}