fix(map): correct hero position calculation and loop order

修复了MissionHeroComp的遍历顺序,同时修正了MissionCardComp中的节点索引计算逻辑,匹配实际的视觉排布和MoveComp中的赋值规则,添加了调试日志方便排查位置问题。
This commit is contained in:
panw
2026-05-13 17:13:55 +08:00
parent 626d27e676
commit 254b7f3e9e
2 changed files with 22 additions and 5 deletions

View File

@@ -197,8 +197,8 @@ export class MissionHeroCompComp extends CCComp {
// 优先中路(1) -> 上路(0) -> 下路(2)
const priority = [1, 0, 2];
for (const lane of priority) {
for (let indexInLane = 0; indexInLane < MissionHeroCompComp.HERO_LANE_CAP; indexInLane++) {
for (let indexInLane = 0; indexInLane < MissionHeroCompComp.HERO_LANE_CAP; indexInLane++) {
for (const lane of priority) {
if (!occupied[lane][indexInLane]) {
return { lane, indexInLane };
}