aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 62fe2de21be..992ad255688 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -14793,6 +14793,20 @@ void Unit::ExitVehicle()
if(!m_vehicle)
return;
+ Unit *vehicleBase = m_vehicle->GetBase();
+ const AuraEffectList &modAuras = vehicleBase->GetAurasByType(SPELL_AURA_CONTROL_VEHICLE);
+ for(AuraEffectList::const_iterator itr = modAuras.begin(); itr != modAuras.end(); ++itr)
+ {
+ if((*itr)->GetParentAura()->GetSourceGUID() == GetGUID())
+ {
+ vehicleBase->RemoveAura((*itr)->GetParentAura());
+ break; // there should be no case that a vehicle has two auras for one source
+ }
+ }
+
+ if(!m_vehicle)
+ return;
+
//sLog.outError("exit vehicle");
m_vehicle->RemovePassenger(this);