mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-08 00:39:10 +00:00
Add height checking to isWithinDistance check.
This commit is contained in:
@@ -221,7 +221,7 @@ public final class Position {
|
|||||||
public boolean isWithinDistance(Position other, int distance) {
|
public boolean isWithinDistance(Position other, int distance) {
|
||||||
int deltaX = Math.abs(getX() - other.getX());
|
int deltaX = Math.abs(getX() - other.getX());
|
||||||
int deltaY = Math.abs(getY() - other.getY());
|
int deltaY = Math.abs(getY() - other.getY());
|
||||||
return deltaX <= distance && deltaY <= distance;
|
return deltaX <= distance && deltaY <= distance && getHeight() == other.getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user