From 70fb7dcf9f8fe33fe200b5b29bc77917ae574303 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Tue, 7 Dec 2021 10:42:37 +0200 Subject: [PATCH] Fixed bug where start node was valid move --- IDAstar.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDAstar.cs b/IDAstar.cs index e8a13f6..dad9343 100644 --- a/IDAstar.cs +++ b/IDAstar.cs @@ -184,7 +184,8 @@ namespace IdaStar continue; } if (_board[neighbour.Row][neighbour.Column] == CellState.OBSTACLE || - _board[neighbour.Row][neighbour.Column] == CellState.PATH) { + _board[neighbour.Row][neighbour.Column] == CellState.PATH || + _board[neighbour.Row][neighbour.Column] == CellState.START) { continue; } @@ -213,7 +214,6 @@ namespace IdaStar var threshold = heuristic(startPoint, destinationPoint); while (threshold != 0) { var newThreshold = search(startPoint, 0, threshold); - AlgorithmStep?.Invoke(this, threshold); if (newThreshold == 0) { threshold = 0; }