cannonplugin: Check world when drawing overlay
This commit is contained in:
@@ -62,7 +62,7 @@ class CannonOverlay extends Overlay
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (!plugin.isCannonPlaced() || plugin.getCannonPosition() == null)
|
||||
if (!plugin.isCannonPlaced() || plugin.getCannonPosition() == null || plugin.getCannonWorld() != client.getWorld())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -86,6 +86,9 @@ public class CannonPlugin extends Plugin
|
||||
@Getter
|
||||
private WorldPoint cannonPosition;
|
||||
|
||||
@Getter
|
||||
private int cannonWorld = -1;
|
||||
|
||||
@Getter
|
||||
private GameObject cannon;
|
||||
|
||||
@@ -139,6 +142,7 @@ public class CannonPlugin extends Plugin
|
||||
overlayManager.remove(cannonOverlay);
|
||||
overlayManager.remove(cannonSpotOverlay);
|
||||
cannonPlaced = false;
|
||||
cannonWorld = -1;
|
||||
cannonPosition = null;
|
||||
cannonBallNotificationSent = false;
|
||||
cballsLeft = 0;
|
||||
@@ -247,6 +251,7 @@ public class CannonPlugin extends Plugin
|
||||
&& localPlayer.getAnimation() == AnimationID.BURYING_BONES)
|
||||
{
|
||||
cannonPosition = gameObject.getWorldLocation();
|
||||
cannonWorld = client.getWorld();
|
||||
cannon = gameObject;
|
||||
}
|
||||
}
|
||||
@@ -257,7 +262,7 @@ public class CannonPlugin extends Plugin
|
||||
{
|
||||
Projectile projectile = event.getProjectile();
|
||||
|
||||
if ((projectile.getId() == CANNONBALL || projectile.getId() == GRANITE_CANNONBALL) && cannonPosition != null)
|
||||
if ((projectile.getId() == CANNONBALL || projectile.getId() == GRANITE_CANNONBALL) && cannonPosition != null && cannonWorld == client.getWorld())
|
||||
{
|
||||
WorldPoint projectileLoc = WorldPoint.fromLocal(client, projectile.getX1(), projectile.getY1(), client.getPlane());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user