mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
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:
@@ -9473,6 +9473,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