Core/Vehicles: Fix a crash in ~Vehicle. Closes #5366
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user