fix(nav): 发出新寻路请求时作废上一次最近可达点,避免跨目标读到过期数据
This commit is contained in:
@@ -580,6 +580,8 @@ namespace PathBerserker2d
|
||||
currentPathRequest.start = currentMappedPosition;
|
||||
currentPathRequest.goals = goalPs;
|
||||
PBWorld.PathTo(currentPathRequest);
|
||||
// 新请求发出 → 作废上一次的最近可达点(避免跨目标读到过期数据);本次若失败会由 RaiseFailedToFindPath 重新写入。
|
||||
_lastClosestReachable = NavSegmentPositionPointer.Invalid;
|
||||
traversedLinkSinceLastPath = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user