fix(Core/Movement): guard empty taxi flight paths (#26468)

This commit is contained in:
Yehonal
2026-07-05 02:19:30 +02:00
committed by GitHub
parent 971a3f46f7
commit b79f7c3312
3 changed files with 51 additions and 24 deletions
+12 -1
View File
@@ -28,6 +28,7 @@
#include "Log.h"
#include "MoveSpline.h"
#include "MoveSplineInit.h"
#include "Player.h"
#include "PointMovementGenerator.h"
#include "RandomMovementGenerator.h"
#include "TargetedMovementGenerator.h"
@@ -837,7 +838,17 @@ void MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode)
{
LOG_DEBUG("movement.motionmaster", "{} taxi to (Path {} node {})", _owner->GetName(), path, pathnode);
FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(pathnode);
mgen->LoadPath(_owner->ToPlayer());
Player* player = _owner->ToPlayer();
if (!mgen->LoadPath(player))
{
LOG_ERROR("movement.motionmaster", "{} failed to build taxi path (Path {} node {}), clearing taxi destinations",
_owner->GetName(), path, pathnode);
player->m_taxi.ClearTaxiDestinations();
player->Dismount();
delete mgen;
return;
}
Mutate(mgen, MOTION_SLOT_CONTROLLED);
}
else