fix(Core/RPG): Clear stale spline + lastPath on quest-complete transition

This commit is contained in:
bash 2026-05-08 22:40:34 +02:00
parent 9d2416a40a
commit 21b68caffc

View File

@ -492,6 +492,15 @@ bool NewRpgDoQuestAction::DoCompletedQuest(NewRpgInfo::DoQuest& data)
data.lastReachPOI = 0; data.lastReachPOI = 0;
data.pos = pos; data.pos = pos;
data.objectiveIdx = -1; 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()) if (data.pos == WorldPosition())