From 21b68caffc2a2b25442f6b59ef29d8f222432612 Mon Sep 17 00:00:00 2001 From: bash Date: Fri, 8 May 2026 22:40:34 +0200 Subject: [PATCH] fix(Core/RPG): Clear stale spline + lastPath on quest-complete transition --- src/Ai/World/Rpg/Action/NewRpgAction.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Ai/World/Rpg/Action/NewRpgAction.cpp b/src/Ai/World/Rpg/Action/NewRpgAction.cpp index 59672e3d7..9923130fa 100644 --- a/src/Ai/World/Rpg/Action/NewRpgAction.cpp +++ b/src/Ai/World/Rpg/Action/NewRpgAction.cpp @@ -492,6 +492,15 @@ bool NewRpgDoQuestAction::DoCompletedQuest(NewRpgInfo::DoQuest& data) data.lastReachPOI = 0; data.pos = pos; data.objectiveIdx = -1; + + // Drop the spline + lastPath that DoIncompleteQuest committed + // to the now-completed objective. Without this, MoveFarTo on + // the next tick hits the bot->isMoving() / lastPath-reuse + // early-exits at the top of MoveFarTo and rides the stale + // path instead of replanning toward the turn-in POI. (This + // is what `.playerbot bot self` masks by recreating the AI.) + bot->GetMotionMaster()->Clear(); + AI_VALUE(LastMovement&, "last movement").clear(); } if (data.pos == WorldPosition())