Core/Units: Fixed crash (previously was a memory leak) when vehicle creatures are deleted without ever being added to world
Closes #29166
This commit is contained in:
1 parent
06aacf757d
commit
4b7aefb05b
1 file changed
+6
@@ -9586,6 +9586,12 @@ void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup)
|
||||
|
||||
if (IsInWorld())
|
||||
RemoveFromWorld();
|
||||
else
|
||||
{
|
||||
// cleanup that must happen even if not in world
|
||||
if (IsVehicle())
|
||||
RemoveVehicleKit(true);
|
||||
}
|
||||
|
||||
ASSERT(GetGUID());
|
||||
|
||||
|
||||
Reference in new issue
Block a user