aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-25 23:55:37 -0500
committermegamage <none@none>2009-08-25 23:55:37 -0500
commit058e6827a69d1d3185109be4ddb8ac235478acf8 (patch)
treec7503f3e59e4077d4e85aeb366970699d661d179 /src/game/Unit.cpp
parent70aea97d53a79f1d17256c36d5e5e8943800f69a (diff)
*Always remove riding aura when exit vehicle.
*Other misc changes. --HG-- branch : trunk
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);