mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 00:38:46 +00:00
Fix getLongestDelta bug reported by lmctruck.
This commit is contained in:
@@ -160,8 +160,8 @@ public final class Position {
|
|||||||
* @return The longest horizontal or vertical delta.
|
* @return The longest horizontal or vertical delta.
|
||||||
*/
|
*/
|
||||||
public int getLongestDelta(Position other) {
|
public int getLongestDelta(Position other) {
|
||||||
int deltaX = x - other.x;
|
int deltaX = Math.abs(x - other.x);
|
||||||
int deltaY = y - other.y;
|
int deltaY = Math.abs(y - other.y);
|
||||||
return Math.max(deltaX, deltaY);
|
return Math.max(deltaX, deltaY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user