diff options
author | Aokromes <aokromes@gmail.com> | 2017-04-16 15:10:48 +0200 |
---|---|---|
committer | Aokromes <aokromes@gmail.com> | 2017-04-16 15:10:48 +0200 |
commit | d8fdc893ee207851270107c1f16dc548800d7d4a (patch) | |
tree | 2334956193aba18a27ee45570d6c85db53727561 /src | |
parent | c0eb6c313053d2437abf2e7fff9ab50645c98559 (diff) |
Commit name: Add flying check to MoveSmoothPath
By Malcrom
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Movement/MotionMaster.cpp | 12 | ||||
-rw-r--r-- | src/server/game/Movement/MotionMaster.h | 4 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/zone_hinterlands.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Kalimdor/zone_mulgore.cpp | 2 |
4 files changed, 12 insertions, 8 deletions
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 271207558c1..8008e32ba73 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -457,17 +457,21 @@ void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool init.Launch(); } -void MotionMaster::MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk) +void MotionMaster::MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk, bool fly) { Movement::PointsArray path(pathPoints, pathPoints + pathSize); - MoveSmoothPath(pointId, path, walk); + MoveSmoothPath(pointId, path, walk, fly); } -void MotionMaster::MoveSmoothPath(uint32 pointId, Movement::PointsArray const& path, bool walk) +void MotionMaster::MoveSmoothPath(uint32 pointId, Movement::PointsArray const& path, bool walk, bool fly) { Movement::MoveSplineInit init(_owner); - if (_owner->CanFly()) + if (fly) + { + init.SetFly(); init.SetUncompressed(); + } + init.MovebyPath(path); init.SetSmooth(); init.SetWalk(walk); diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index 7461a5c44a6..467783ca116 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -207,8 +207,8 @@ class TC_GAME_API MotionMaster //: private std::stack<MovementGenerator *> } void MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint32 id = EVENT_JUMP, bool hasOrientation = false, JumpArrivalCastArgs const* arrivalCast = nullptr, Movement::SpellEffectExtraData const* spellEffectExtraData = nullptr); void MoveCirclePath(float x, float y, float z, float radius, bool clockwise, uint8 stepCount); - void MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk); - void MoveSmoothPath(uint32 pointId, Movement::PointsArray const& points, bool walk); + void MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk = false, bool fly = false); + void MoveSmoothPath(uint32 pointId, Movement::PointsArray const& points, bool walk = false, bool fly = false); // Walk along spline chain stored in DB (script_spline_chain_meta and script_spline_chain_waypoints) void MoveAlongSplineChain(uint32 pointId, uint16 dbChainId, bool walk); void MoveAlongSplineChain(uint32 pointId, SplineChain const& chain, bool walk); diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp index 7b5db096ab8..dcdbd684e8a 100644 --- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp @@ -215,7 +215,7 @@ public: endPoint = campPathSize; break; case NPC_SHARPBEAK_JINTHAALOR: - me->GetMotionMaster()->MoveSmoothPath(jinthaalorPathSize, jinthaalorPath, jinthaalorPathSize, false); + me->GetMotionMaster()->MoveSmoothPath(jinthaalorPathSize, jinthaalorPath, jinthaalorPathSize, false, true); endPoint = jinthaalorPathSize; break; } diff --git a/src/server/scripts/Kalimdor/zone_mulgore.cpp b/src/server/scripts/Kalimdor/zone_mulgore.cpp index f4a546c1f5c..15fa1a46ffd 100644 --- a/src/server/scripts/Kalimdor/zone_mulgore.cpp +++ b/src/server/scripts/Kalimdor/zone_mulgore.cpp @@ -54,7 +54,7 @@ public: if (!apply) return; - me->GetMotionMaster()->MoveSmoothPath(EagleSpiritflightPathSize, EagleSpiritflightPath, EagleSpiritflightPathSize, false); + me->GetMotionMaster()->MoveSmoothPath(EagleSpiritflightPathSize, EagleSpiritflightPath, EagleSpiritflightPathSize, false, true); me->CastSpell(me, SPELL_SPIRIT_FORM); } |