Core/Units: Fixed crash (previously was a memory leak) when vehicle creatures are deleted without ever being added to world
Port From (https://github.com/TrinityCore/TrinityCore/commit/40cdf0750d40668692660db817c5fc19d53aea2e)
This commit is contained in:
@@ -518,6 +518,12 @@ namespace Game.Entities
|
||||
|
||||
if (IsInWorld)
|
||||
RemoveFromWorld();
|
||||
else
|
||||
{
|
||||
// cleanup that must happen even if not in world
|
||||
if (IsVehicle())
|
||||
RemoveVehicleKit(true);
|
||||
}
|
||||
|
||||
// A unit may be in removelist and not in world, but it is still in grid
|
||||
// and may have some references during delete
|
||||
|
||||
Reference in New Issue
Block a user