From 042c99d3d0c7f591039f015e41cae2d4747375bb Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 27 Jul 2018 18:25:44 -0400 Subject: [PATCH] perspective: change worldToMinimap location calculation back This is how the client calculates positions for npcs/players. Originally I had thought it fixed an issue with minimap overlays being off, but it was due to the constants we were using in worldToMinimap being off in order to account for renderMinimapLocation being wrong --- .../src/main/java/net/runelite/api/Perspective.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Perspective.java b/runelite-api/src/main/java/net/runelite/api/Perspective.java index caa71b3c91..7f848c9521 100644 --- a/runelite-api/src/main/java/net/runelite/api/Perspective.java +++ b/runelite-api/src/main/java/net/runelite/api/Perspective.java @@ -180,10 +180,8 @@ public class Perspective public static Point worldToMiniMap(@Nonnull Client client, int x, int y, int distance) { LocalPoint localLocation = client.getLocalPlayer().getLocalLocation(); - final int sceneX = x >>> LOCAL_COORD_BITS; - final int sceneY = y >>> LOCAL_COORD_BITS; - x = sceneX * 4 + 2 - localLocation.getX() / 32; - y = sceneY * 4 + 2 - localLocation.getY() / 32; + x = x / 32 - localLocation.getX() / 32; + y = y / 32 - localLocation.getY() / 32; int dist = x * x + y * y; if (dist < distance)