From 792914fb518349ef270e6f769f343bbcd333b942 Mon Sep 17 00:00:00 2001 From: Treeston Date: Tue, 2 Oct 2018 19:53:55 +0200 Subject: Core/Movement: Add some extra assertions to MotionMaster to catch issues like #22444 earlier in the future. (cherry picked from commit ead439fbd6620ab53530c3d1d28b4755280a1059) --- src/server/game/Movement/MotionMaster.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/server/game/Movement/MotionMaster.cpp') 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); -- cgit v1.2.3