Core/Vehicles: Fix a crash in ~Vehicle. Closes #5366

This commit is contained in:
Machiavelli
2012-02-22 16:51:56 +01:00
parent 656f8f8d04
commit c9748aaacc
+5 -1
View File
@@ -281,7 +281,6 @@ Unit::~Unit()
_DeleteRemovedAuras();
delete m_charmInfo;
delete m_vehicleKit;
delete movespline;
ASSERT(!m_duringRemoveFromWorld);
@@ -13683,7 +13682,11 @@ void Unit::RemoveFromWorld()
{
m_duringRemoveFromWorld = true;
if (IsVehicle())
{
GetVehicleKit()->Uninstall();
delete m_vehicleKit;
m_vehicleKit = NULL;
}
RemoveCharmAuras();
RemoveBindSightAuras();
@@ -13692,6 +13695,7 @@ void Unit::RemoveFromWorld()
RemoveAllGameObjects();
RemoveAllDynObjects();
ExitVehicle(); // Remove applied auras with SPELL_AURA_CONTROL_VEHICLE
UnsummonAllTotems();
RemoveAllControlled();