Add WorldPoint::getRegionID
This commit is contained in:
@@ -165,4 +165,9 @@ public class WorldPoint
|
||||
{
|
||||
return new Point(x, y);
|
||||
}
|
||||
|
||||
public int getRegionID()
|
||||
{
|
||||
return ((x >> 6) << 8) | (y >> 6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,9 +62,7 @@ public class LocationOverlay extends Overlay
|
||||
WorldPoint localWorld = client.getLocalPlayer().getWorldLocation();
|
||||
LocalPoint localPoint = client.getLocalPlayer().getLocalLocation();
|
||||
|
||||
int regionX = localWorld.getX() >> 6;
|
||||
int regionY = localWorld.getY() >> 6;
|
||||
int regionID = regionX << 8 | regionY;
|
||||
int regionID = localWorld.getRegionID();
|
||||
|
||||
if (client.isInInstancedRegion())
|
||||
{
|
||||
|
||||
@@ -342,9 +342,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
worldPoint = WorldPoint.fromLocal(client, localPoint);
|
||||
}
|
||||
|
||||
int regionX = worldPoint.getX() >> 6;
|
||||
int regionY = worldPoint.getY() >> 6;
|
||||
int regionId = regionX << 8 | regionY;
|
||||
int regionId = worldPoint.getRegionID();
|
||||
GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getX() & 0x3f, worldPoint.getY() & 0x3f, client.getPlane());
|
||||
log.debug("Updating point: {} - {}", point, worldPoint);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user