mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 00:38:21 +00:00
Fix A* pathfinding when height is greater than zero
This commit is contained in:
@@ -11,8 +11,6 @@ import java.util.Set;
|
||||
|
||||
import org.apollo.game.model.Direction;
|
||||
import org.apollo.game.model.Position;
|
||||
import org.apollo.game.model.World;
|
||||
import org.apollo.game.model.area.RegionRepository;
|
||||
import org.apollo.game.model.area.collision.CollisionManager;
|
||||
|
||||
/**
|
||||
@@ -76,7 +74,7 @@ public final class AStarPathfindingAlgorithm extends PathfindingAlgorithm {
|
||||
continue;
|
||||
}
|
||||
|
||||
Position adjacent = new Position(nextX, nextY);
|
||||
Position adjacent = new Position(nextX, nextY, position.getHeight());
|
||||
Direction direction = Direction.between(adjacent, position);
|
||||
if (traversable(adjacent, direction)) {
|
||||
Node node = nodes.computeIfAbsent(adjacent, Node::new);
|
||||
|
||||
Reference in New Issue
Block a user