From 43aecc42aacfa4fdcc3d77153199fcea6d6cdb59 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Wed, 12 Apr 2017 23:21:58 +0200 Subject: [PATCH] Commit name: Add flying check to MoveSmoothPath By Malcrom --- src/server/game/Movement/MotionMaster.cpp | 13 +++++++------ src/server/game/Movement/MotionMaster.h | 4 ++-- .../scripts/EasternKingdoms/zone_hinterlands.cpp | 2 +- src/server/scripts/Kalimdor/zone_mulgore.cpp | 2 +- src/server/scripts/Spells/spell_mage.cpp | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 3bc50fb9dd5..44fd17c8adb 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -515,25 +515,26 @@ 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); init.Launch(); - + // This code is not correct // EffectMovementGenerator does not affect UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE // need to call PointMovementGenerator with various pointIds diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index 201839e8ced..3efa36e9f73 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -146,8 +146,8 @@ class TC_GAME_API MotionMaster } void MoveJump(float x, float y, float z, float o, float speedXY, float speedZ, uint32 id = EVENT_JUMP, bool hasOrientation = false); 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, bool fly); + void MoveSmoothPath(uint32 pointId, Movement::PointsArray const& points, bool walk, bool fly); // 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 0c6aa0e1202..aafa6fa102a 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); } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 716ba7f2ce3..00f692853fa 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -35,7 +35,7 @@ enum MageSpells SPELL_ARCANCE_POTENCY_RANK_2 = 31572, SPELL_ARCANCE_POTENCY_TRIGGER_RANK_1 = 57529, SPELL_ARCANCE_POTENCY_TRIGGER_RANK_2 = 57531, - SPELL_MAGE_ARCANE_MISSILES = 79808 + SPELL_MAGE_ARCANE_MISSILES = 79808, SPELL_MAGE_BLAZING_SPEED = 31643, SPELL_MAGE_BURNOUT = 29077, SPELL_MAGE_COLD_SNAP = 11958,