Add height checking to isWithinDistance check.

This commit is contained in:
thispixel
2015-03-02 19:34:21 +00:00
parent 012073584f
commit 3c9d6f0910
+1 -1
View File
@@ -221,7 +221,7 @@ public final class Position {
public boolean isWithinDistance(Position other, int distance) {
int deltaX = Math.abs(getX() - other.getX());
int deltaY = Math.abs(getY() - other.getY());
return deltaX <= distance && deltaY <= distance;
return deltaX <= distance && deltaY <= distance && getHeight() == other.getHeight();
}
@Override