From a3f3058499ee0f35c684588a386c6b69683adf70 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Wed, 22 Feb 2012 12:26:05 +0100 Subject: Core/Vehicles: Remove some wrong/redundant calls to Unit::ExitVehicle. The aura system already handles it in most places. Also add some documentation on upcoming work on making passenger exit positions work. --- src/server/game/Entities/Unit/Unit.cpp | 17 +++++++++++------ .../scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0e3e2f593fa..70ca35b7203 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13692,7 +13692,6 @@ void Unit::RemoveFromWorld() RemoveAllGameObjects(); RemoveAllDynObjects(); - ExitVehicle(); UnsummonAllTotems(); RemoveAllControlled(); @@ -15591,9 +15590,6 @@ void Unit::Kill(Unit* victim, bool durabilityLoss) if (Player* killed = victim->ToPlayer()) sScriptMgr->OnPlayerKilledByCreature(killerCre, killed); } - - if (victim->GetVehicle()) - victim->ExitVehicle(); } void Unit::SetControlled(bool apply, UnitState state) @@ -17002,12 +16998,21 @@ void Unit::ChangeSeat(int8 seatId, bool next) void Unit::ExitVehicle(Position const* exitPosition) { - // This function can be called at upper level code to initialize an exit from the passenger's side. + //! This function can be called at upper level code to initialize an exit from the passenger's side. if (!m_vehicle) return; GetVehicleBase()->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, GetGUID()); - _ExitVehicle(exitPosition); + //! The following call would not even be executed successfully as the + //! SPELL_AURA_CONTROL_VEHICLE unapply handler already calls _ExitVehicle without + //! specifying an exitposition. The subsequent call below would return on if (!m_vehicle). + /*_ExitVehicle(exitPosition);*/ + //! To do: + //! We need to allow SPELL_AURA_CONTROL_VEHICLE unapply handlers in spellscripts + //! to specify exit coordinates and either store those per passenger, or we need to + //! init spline movement based on those coordinates in unapply handlers, and + //! relocate exiting passengers based on Unit::moveSpline data. Either way, + //! Coming Soon™ } void Unit::_ExitVehicle(Position const* exitPosition) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp index a156e6ef08b..d5034e4827e 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_kologarn.cpp @@ -485,6 +485,8 @@ class spell_ulduar_squeezed_lifeless : public SpellScriptLoader if (!GetHitPlayer() || !GetHitPlayer()->GetVehicle()) return; + //! Proper exit position does not work currently, + //! See documentation in void Unit::ExitVehicle(Position const* exitPosition) Position pos; pos.m_positionX = 1756.25f + irand(-3, 3); pos.m_positionY = -8.3f + irand(-3, 3); -- cgit v1.2.3