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())
|
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);
|
pet->Unsummon(PET_SAVE_AS_DELETED, this);
|
||||||
|
|
||||||
m_guardianPets.erase(m_guardianPets.begin());
|
m_guardianPets.erase(guid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11491"
|
#define REVISION_NR "11492"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue