mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[11492] Fix possible crash at guardian pet unsummon
This commit is contained in:
parent
55cc1ea37f
commit
05cfb8d36b
2 changed files with 5 additions and 3 deletions
|
|
@ -5962,10 +5962,12 @@ void Unit::RemoveGuardians()
|
|||
{
|
||||
while (!m_guardianPets.empty())
|
||||
{
|
||||
if (Pet* pet = GetMap()->GetPet(*m_guardianPets.begin()))
|
||||
ObjectGuid guid = *m_guardianPets.begin();
|
||||
|
||||
if (Pet* pet = GetMap()->GetPet(guid))
|
||||
pet->Unsummon(PET_SAVE_AS_DELETED, this);
|
||||
|
||||
m_guardianPets.erase(m_guardianPets.begin());
|
||||
m_guardianPets.erase(guid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue