mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 13:20:43 +00:00
PathFinder: return path not found when src or dst is null (#228)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user