api: make getCanvasTilePoly work on multi-tile npcs

This commit is contained in:
Adam
2021-09-04 16:29:46 -04:00
parent adf0d75be8
commit cdbb0a3aa7
3 changed files with 3 additions and 12 deletions

View File

@@ -283,7 +283,7 @@ public interface Actor extends Renderable
void setSpotAnimFrame(int spotAnimFrame);
/**
* Gets the canvas area of the current tile the actor is standing on.
* Gets the canvas area of the current tiles the actor is standing on.
*
* @return the current tile canvas area
*/

View File

@@ -35,8 +35,6 @@ import java.util.Set;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.NPC;
import net.runelite.api.NPCComposition;
import net.runelite.api.Perspective;
import net.runelite.api.Point;
import net.runelite.api.Tile;
import net.runelite.api.coords.LocalPoint;
@@ -157,11 +155,7 @@ class AgilityOverlay extends Overlay
Color color = config.sepulchreHighlightColor();
for (NPC npc : npcs)
{
NPCComposition npcComposition = npc.getComposition();
int size = npcComposition.getSize();
LocalPoint lp = npc.getLocalLocation();
Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size);
Polygon tilePoly = npc.getCanvasTilePoly();
if (tilePoly != null)
{
OverlayUtil.renderPolygon(graphics, tilePoly, color);

View File

@@ -162,10 +162,7 @@ public class NpcSceneOverlay extends Overlay
if (highlightedNpc.isTile())
{
int size = npcComposition.getSize();
LocalPoint lp = actor.getLocalLocation();
Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, lp, size);
Polygon tilePoly = actor.getCanvasTilePoly();
renderPoly(graphics, borderColor, fillColor, tilePoly);
}