1658 {
1662 if (
Unit* passenger = vehicle->GetPassenger(3))
1663 {
1664
1665 std::list<WorldObject*> targetList;
1669 float minDist = 99 * 99;
1670 Unit* target =
nullptr;
1671 for (std::list<WorldObject*>::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
1672 {
1675 if (
Vehicle* seat = unit->GetVehicleKit())
1676 if (!seat->GetPassenger(0))
1677 if (
Unit* device = seat->GetPassenger(2))
1679 {
1681 if (dist < minDist)
1682 {
1683 minDist = dist;
1684 target = unit;
1685 }
1686 }
1687 }
1689 {
1691 passenger->EnterVehicle(target, 0);
1692 }
1693 else
1694 {
1695 passenger->ExitVehicle();
1696 float x, y, z;
1698 passenger->GetMotionMaster()->MoveJump(x, y, z, targets.
GetSpeedXY(), targets.
GetSpeedZ());
1699 }
1700 }
1701 }
@ EFFECT_0
Definition SharedDefines.h:31
@ TARGET_CHECK_DEFAULT
Definition SpellInfo.h:114
@ CURRENT_CHANNELED_SPELL
Definition Unit.h:540
@ NPC_SEAT
Definition boss_flame_leviathan.cpp:92
Unit * ToUnit()
Definition Object.h:210
float GetSpeedZ() const
Definition Spell.h:177
float GetSpeedXY() const
Definition Spell.h:176
WorldLocation const * GetDstPos() const
Definition Spell.cpp:401
WorldLocation const * GetExplTargetDest()
Definition SpellScript.cpp:416
SpellInfo const * GetSpellInfo()
Definition SpellScript.cpp:411
Spell * GetSpell()
Definition SpellScript.h:442
Unit * GetCaster()
Definition SpellScript.cpp:401
SpellCastTargets m_targets
Definition Spell.h:530
void ExitVehicle(Position const *exitPosition=nullptr)
Definition Unit.cpp:19515
bool IsWithinDist2d(float x, float y, float dist) const
Definition Object.cpp:1316
Definition GridNotifiers.h:239
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:185
void GetPosition(float &x, float &y) const
Definition Position.h:126
float GetExactDistSq(float x, float y, float z) const
Definition Position.h:174