From ead439fbd6620ab53530c3d1d28b4755280a1059 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. --- 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 ebccc6fa481..018550c079e 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -950,7 +950,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(pathnode); movement->LoadPath(_owner->ToPlayer()); -- cgit v1.2.3