From bdb480ee6b466407555f76d4be4e9e27d879127f Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 11 Jun 2022 11:35:39 -0400 Subject: [PATCH] npc overlay: use true tile for south west tile --- .../client/game/npcoverlay/NpcOverlay.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlay.java b/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlay.java index 803c44fe26..3ed64c499b 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/game/npcoverlay/NpcOverlay.java @@ -105,15 +105,12 @@ class NpcOverlay extends Overlay if (highlightedNpc.isSwTile()) { - int size = npcComposition.getSize(); - LocalPoint lp = actor.getLocalLocation(); - - int x = lp.getX() - ((size - 1) * Perspective.LOCAL_TILE_SIZE / 2); - int y = lp.getY() - ((size - 1) * Perspective.LOCAL_TILE_SIZE / 2); - - Polygon southWestTilePoly = Perspective.getCanvasTilePoly(client, new LocalPoint(x, y)); - - renderPoly(graphics, borderColor, borderWidth, fillColor, southWestTilePoly); + LocalPoint lp = LocalPoint.fromWorld(client, actor.getWorldLocation()); + if (lp != null) + { + Polygon tilePoly = Perspective.getCanvasTilePoly(client, lp); + renderPoly(graphics, borderColor, borderWidth, fillColor, tilePoly); + } } if (highlightedNpc.isOutline())