fix(nav): 发出新寻路请求时作废上一次最近可达点,避免跨目标读到过期数据

This commit is contained in:
2026-07-23 17:05:27 +08:00
parent 675e1950af
commit d84e66fcb9
@@ -580,6 +580,8 @@ namespace PathBerserker2d
currentPathRequest.start = currentMappedPosition;
currentPathRequest.goals = goalPs;
PBWorld.PathTo(currentPathRequest);
// 新请求发出 → 作废上一次的最近可达点(避免跨目标读到过期数据);本次若失败会由 RaiseFailedToFindPath 重新写入。
_lastClosestReachable = NavSegmentPositionPointer.Invalid;
traversedLinkSinceLastPath = false;
return true;
}