mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 16:49:12 +00:00
Fix missing direction in a* traversable call
This commit is contained in:
@@ -9,6 +9,7 @@ import java.util.PriorityQueue;
|
|||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.apollo.game.model.Direction;
|
||||||
import org.apollo.game.model.Position;
|
import org.apollo.game.model.Position;
|
||||||
import org.apollo.game.model.area.RegionRepository;
|
import org.apollo.game.model.area.RegionRepository;
|
||||||
|
|
||||||
@@ -73,7 +74,8 @@ public final class AStarPathfindingAlgorithm extends PathfindingAlgorithm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Position adjacent = new Position(nextX, nextY);
|
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);
|
Node node = nodes.computeIfAbsent(adjacent, Node::new);
|
||||||
compare(active, node, open, sorted, heuristic);
|
compare(active, node, open, sorted, heuristic);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user