fix(Core/Scripts): Fix the wrong run in npc_escortAI (#23293)

Co-authored-by: 天鹭 <18535853+PkllonG@users.noreply.github.com>
This commit is contained in:
killerwife
2025-10-24 08:43:18 +02:00
committed by GitHub
parent 0779ece252
commit a8d07b669d
49 changed files with 120 additions and 75 deletions

View File

@@ -49,6 +49,8 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mForcedPaused = false;
mForcedMovement = FORCED_MOVEMENT_NONE;
mEscortQuestID = 0;
mDespawnTime = 0;
@@ -205,6 +207,7 @@ void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat,
{
AddEscortState(SMART_ESCORT_ESCORTING);
mCanRepeatPath = repeat;
mForcedMovement = forcedMovement;
if (invoker && invoker->IsPlayer())
{
@@ -215,7 +218,7 @@ void SmartAI::StartPath(ForcedMovement forcedMovement, uint32 path, bool repeat,
Movement::PointsArray pathPoints;
GenerateWayPointArray(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints, forcedMovement);
me->GetMotionMaster()->MoveSplinePath(&pathPoints, mForcedMovement);
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, wp->id, GetScript()->GetPathId());
}
}
@@ -373,7 +376,7 @@ void SmartAI::ResumePath()
Movement::PointsArray pathPoints;
GenerateWayPointArray(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints);
me->GetMotionMaster()->MoveSplinePath(&pathPoints, mForcedMovement);
}
}

View File

@@ -241,6 +241,7 @@ private:
bool mCanAutoAttack;
bool mForcedPaused;
uint32 mInvincibilityHpLevel;
ForcedMovement mForcedMovement;
bool AssistPlayerInCombatAgainst(Unit* who);