Browse Source

Fixed bug where start node was valid move

master
Kenneth Bruen 3 years ago
parent
commit
70fb7dcf9f
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 4
      IDAstar.cs

4
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;
}

Loading…
Cancel
Save