Core/Vehicles: Properly remove casted vehicle auras (caster guid is what we must check, not owner)
This commit is contained in:
@@ -16637,17 +16637,7 @@ void Unit::ExitVehicle(Position const* exitPosition)
|
||||
if (!m_vehicle)
|
||||
return;
|
||||
|
||||
Unit *vehicleBase = m_vehicle->GetBase();
|
||||
const AuraEffectList &modAuras = vehicleBase->GetAuraEffectsByType(SPELL_AURA_CONTROL_VEHICLE);
|
||||
for (AuraEffectList::const_iterator itr = modAuras.begin(); itr != modAuras.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->GetBase()->GetOwner() == this)
|
||||
{
|
||||
vehicleBase->RemoveAura((*itr)->GetBase());
|
||||
break; // there should be no case that a vehicle has two auras for one owner
|
||||
}
|
||||
}
|
||||
|
||||
GetVehicleBase()->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, GetGUID());
|
||||
_ExitVehicle(exitPosition);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user