PathFinder: return path not found when src or dst is null (#228)

This commit is contained in:
evanpelle
2025-03-12 12:59:36 -07:00
committed by GitHub
parent 8b5d402d96
commit 439f5af2bd
+2
View File
@@ -46,9 +46,11 @@ export class PathFinder {
nextTile(curr: TileRef, dst: TileRef, dist: number = 1): TileResult {
if (curr == null) {
consolex.error("curr is null");
return { type: PathFindResultType.PathNotFound };
}
if (dst == null) {
consolex.error("dst is null");
return { type: PathFindResultType.PathNotFound };
}
if (this.game.manhattanDist(curr, dst) < dist) {