Fix missing direction in a* traversable call

This commit is contained in:
Gary Tierney
2016-02-09 23:39:17 +00:00
parent b76445bad3
commit 1ef364beb8
@@ -9,6 +9,7 @@ import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
import org.apollo.game.model.Direction;
import org.apollo.game.model.Position;
import org.apollo.game.model.area.RegionRepository;
@@ -73,7 +74,8 @@ public final class AStarPathfindingAlgorithm extends PathfindingAlgorithm {
}
Position adjacent = new Position(nextX, nextY);
if (traversable(adjacent)) {
Direction direction = Direction.between(adjacent, position);
if (traversable(adjacent, direction)) {
Node node = nodes.computeIfAbsent(adjacent, Node::new);
compare(active, node, open, sorted, heuristic);
}