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