fix bugs from using tilerefs

This commit is contained in:
Evan
2025-02-01 12:05:11 -08:00
parent f0f5bae79f
commit b91d9d4148
14 changed files with 41 additions and 62 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ export class MiniAStar implements AStar {
}
reconstructPath(): TileRef[] {
const upscaled = upscalePath(this.aStar.reconstructPath().map(tr => new Cell(this.gameMap.x(tr), this.gameMap.y(tr))))
const upscaled = upscalePath(this.aStar.reconstructPath().map(tr => new Cell(this.miniMap.x(tr), this.miniMap.y(tr))))
upscaled.push(new Cell(this.gameMap.x(this.dst), this.gameMap.y(this.dst)))
return upscaled.map(c => this.gameMap.ref(c.x, c.y))
}