mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
*Cleanups before delete after not successfull load pet from db. Thanks to Drahy for debug traces.
--HG-- branch : trunk
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user