aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Movement/MotionMaster.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2018-10-02 19:53:55 +0200
committerShauren <shauren.trinity@gmail.com>2021-11-12 00:16:30 +0100
commit792914fb518349ef270e6f769f343bbcd333b942 (patch)
treeca5cc186a75dd24ba0e0273203fd50d0cd5d0e96 /src/server/game/Movement/MotionMaster.cpp
parentd59854d176691bde2a9d13ae364c09534aa82ba6 (diff)
Core/Movement: Add some extra assertions to MotionMaster to catch issues like #22444 earlier in the future.
(cherry picked from commit ead439fbd6620ab53530c3d1d28b4755280a1059)
Diffstat (limited to 'src/server/game/Movement/MotionMaster.cpp')
-rw-r--r--src/server/game/Movement/MotionMaster.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index b7c76bd4431..a3c8b04f9a7 100644
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -974,7 +974,8 @@ void MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode)
TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveTaxiFlight: '%s', taxi to path Id: %u (node %u)", _owner->GetGUID().ToString().c_str(), path, pathnode);
// Only one FLIGHT_MOTION_TYPE is allowed
- Remove(FLIGHT_MOTION_TYPE);
+ bool hasExisting = HasMovementGenerator([](MovementGenerator const* gen) { return gen->GetMovementGeneratorType() == FLIGHT_MOTION_TYPE; });
+ ASSERT(!hasExisting, "Duplicate flight path movement generator");
FlightPathMovementGenerator* movement = new FlightPathMovementGenerator();
movement->LoadPath(_owner->ToPlayer(), pathnode);