Core/Vehicles

* Fixed crash happening when passenger died on vehicle he was controlling
* Fixed crash happening if vehicle control aura was removed before passenger is fully added to vehicle

Closes #7160
This commit is contained in:
Shauren committed 2013-03-13 11:34:58 +01:00
1 parent a0f4937fbc
commit 2c169bcca5
6 files changed
+40 -3

No files matched your search

+6
View File
@@ -12419,6 +12419,9 @@ void Unit::setDeathState(DeathState s)
if (IsNonMeleeSpellCasted(false))
InterruptNonMeleeSpells(false);
ExitVehicle(); // Exit vehicle before calling RemoveAllControlled
// vehicles use special type of charm that is not removed by the next function
// triggering an assert
UnsummonAllTotems();
RemoveAllControlled();
RemoveAllAurasOnDeath();
@@ -16842,7 +16845,10 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
if (Player* player = ToPlayer())
{
if (vehicle->GetBase()->GetTypeId() == TYPEID_PLAYER && player->isInCombat())
{
vehicle->GetBase()->RemoveAura(const_cast<AuraApplication*>(aurApp));
return;
}
}
ASSERT(!m_vehicle);