diff --git a/.planning/phases/02-pathfinding/deferred-items.md b/.planning/phases/02-pathfinding/deferred-items.md index 74846c4..0d0e771 100644 --- a/.planning/phases/02-pathfinding/deferred-items.md +++ b/.planning/phases/02-pathfinding/deferred-items.md @@ -21,3 +21,10 @@ status: open **What:** 阶段门禁 `pnpm lint:user` 仍被本计划未修改的渲染与 legacy 文件阻塞;计划归属文件的 ESLint 检查为 0 problems,按范围边界规则不修复无关基线问题。 + +- data-state/src/hero/moverImpl.ts 的 TS18047 诊断(`loc.static` 可能为 `null`) + status: resolved + **What:** `commonTrigger` 的静态图块事件收集在可空 `ILayerLocation.static` 上直接调用 + `tileEvent()`,导致计划归属文件的类型门禁失败。 + **Resolution:** 仅在 `loc.static` 非空时收集静态图块事件;动态事件收集、优先级排序、来源环境 + 与单次 executor 调用保持不变。 diff --git a/packages-user/data-state/src/hero/moverImpl.ts b/packages-user/data-state/src/hero/moverImpl.ts index 8a9278f..7b6ec40 100644 --- a/packages-user/data-state/src/hero/moverImpl.ts +++ b/packages-user/data-state/src/hero/moverImpl.ts @@ -202,13 +202,15 @@ export class DefaultHeroMoveTopImpl implements IHeroMoveTopImpl { } } if (loc) { - for (const [priority, id] of loc.static.tileEvent().get()) { - tileSources.push({ - priority, - id, - type: BlockEventType.TileEvent, - tile: loc.static - }); + if (loc.static) { + for (const [priority, id] of loc.static.tileEvent().get()) { + tileSources.push({ + priority, + id, + type: BlockEventType.TileEvent, + tile: loc.static + }); + } } for (const tile of loc.dynamics) { for (const [priority, id] of tile.tileEvent().get()) { diff --git a/packages-user/data-state/src/path/heroPathfinding.ts b/packages-user/data-state/src/path/heroPathfinding.ts index 8bb413f..9696659 100644 --- a/packages-user/data-state/src/path/heroPathfinding.ts +++ b/packages-user/data-state/src/path/heroPathfinding.ts @@ -202,6 +202,10 @@ export class HeroPathfinding implements IHeroPathfinding { this.system.useMover(mover); } + useMovable(movable: IObjectMovable | null): void { + this.system.useMovable(movable); + } + useFallbackPolicy(policy: PathFallbackPolicy | null): void { this.system.useFallbackPolicy(policy); }