Core/Maps: Fix crash caused by setActive(false) called after DespawnOrUnsummon()
Fix crash caused by WorldObject::setActive(false) called after WorldObject::DespawnOrUnsummon() happening because the WorldObject would be set as not active but then Map::RemoveFromActiveHelper() would not be called because of not being in world anymore. Whenever setActive() gets desync'd with what Map actually contains a rare crash would happen since Map only reads a few values of the active WorldObject, making it hard to reproduce. If this happens again some ASSERT calls should be added (or a check in Map::RemoveFromMap() could be added about if the WorldObject is in Map::m_activeNonPlayers container).
This commit is contained in:
1 parent
1681889fdd
commit
0020ea9f92
1 file changed
+1
-1
@@ -1235,7 +1235,7 @@ void WorldObject::setActive(bool on)
|
||||
|
||||
m_isActive = on;
|
||||
|
||||
if (!IsInWorld())
|
||||
if (on && !IsInWorld())
|
||||
return;
|
||||
|
||||
Map* map = FindMap();
|
||||
|
||||
Reference in new issue
Block a user