fix(Core/Movement): guard empty taxi flight paths (#26468)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user