flexo: MErge nested if statements
This commit is contained in:
@@ -172,15 +172,12 @@ public class FlexoPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
for (NPC npc : client.getNpcs())
|
for (NPC npc : client.getNpcs())
|
||||||
{
|
{
|
||||||
if (npc != null)
|
if (npc != null && npc.getConvexHull() != null)
|
||||||
{
|
{
|
||||||
if (npc.getConvexHull() != null)
|
Rectangle r = FlexoMouse.getClickArea(npc.getConvexHull().getBounds());
|
||||||
{
|
this.clickAreas.add(r);
|
||||||
Rectangle r = FlexoMouse.getClickArea(npc.getConvexHull().getBounds());
|
java.awt.Point p = FlexoMouse.getClickPoint(r);
|
||||||
this.clickAreas.add(r);
|
this.clickPoints.add(p);
|
||||||
java.awt.Point p = FlexoMouse.getClickPoint(r);
|
|
||||||
this.clickPoints.add(p);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -194,15 +191,12 @@ public class FlexoPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
for (Player player : client.getPlayers())
|
for (Player player : client.getPlayers())
|
||||||
{
|
{
|
||||||
if (player != null)
|
if (player != null && player.getConvexHull() != null)
|
||||||
{
|
{
|
||||||
if (player.getConvexHull() != null)
|
Rectangle r = FlexoMouse.getClickArea(player.getConvexHull().getBounds());
|
||||||
{
|
this.clickAreas.add(r);
|
||||||
Rectangle r = FlexoMouse.getClickArea(player.getConvexHull().getBounds());
|
java.awt.Point p = FlexoMouse.getClickPoint(r);
|
||||||
this.clickAreas.add(r);
|
this.clickPoints.add(p);
|
||||||
java.awt.Point p = FlexoMouse.getClickPoint(r);
|
|
||||||
this.clickPoints.add(p);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -214,27 +208,21 @@ public class FlexoPlugin extends Plugin
|
|||||||
Flexo.isStretched = client.isStretchedEnabled();
|
Flexo.isStretched = client.isStretchedEnabled();
|
||||||
Flexo.scale = this.scalingFactor;
|
Flexo.scale = this.scalingFactor;
|
||||||
|
|
||||||
if (flexo != null)
|
if (flexo != null && GroundItemsPlugin.getCollectedGroundItems() != null)
|
||||||
{
|
{
|
||||||
if (GroundItemsPlugin.getCollectedGroundItems() != null)
|
for (GroundItem gi : GroundItemsPlugin.getCollectedGroundItems().values())
|
||||||
{
|
{
|
||||||
for (GroundItem gi : GroundItemsPlugin.getCollectedGroundItems().values())
|
if (gi != null)
|
||||||
{
|
{
|
||||||
if (gi != null)
|
LocalPoint lp = LocalPoint.fromWorld(client, gi.getLocation());
|
||||||
|
if (lp != null && Perspective.getCanvasTilePoly(client, lp) != null)
|
||||||
{
|
{
|
||||||
LocalPoint lp = LocalPoint.fromWorld(client, gi.getLocation());
|
Rectangle r1 = FlexoMouse.getClickArea(Perspective.getCanvasTilePoly(client, lp).getBounds());
|
||||||
if (lp != null)
|
Rectangle r2 = FlexoMouse.getClickArea(r1);
|
||||||
{
|
Rectangle r3 = FlexoMouse.getClickArea(r2);
|
||||||
if (Perspective.getCanvasTilePoly(client, lp) != null)
|
this.clickAreas.add(r3);
|
||||||
{
|
java.awt.Point p = FlexoMouse.getClickPoint(r3);
|
||||||
Rectangle r1 = FlexoMouse.getClickArea(Perspective.getCanvasTilePoly(client, lp).getBounds());
|
this.clickPoints.add(p);
|
||||||
Rectangle r2 = FlexoMouse.getClickArea(r1);
|
|
||||||
Rectangle r3 = FlexoMouse.getClickArea(r2);
|
|
||||||
this.clickAreas.add(r3);
|
|
||||||
java.awt.Point p = FlexoMouse.getClickPoint(r3);
|
|
||||||
this.clickPoints.add(p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user