safespot: Merge nested if statements
This commit is contained in:
@@ -42,25 +42,19 @@ public class SafeSpotOverlay extends Overlay
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (safeSpotPlugin.isSafeSpotsRenderable())
|
||||
if (safeSpotPlugin.isSafeSpotsRenderable() && safeSpotPlugin.getSafeSpotList() != null && safeSpotPlugin.getSafeSpotList().size() > 0)
|
||||
{
|
||||
if (safeSpotPlugin.getSafeSpotList() != null)
|
||||
safeSpotPlugin.getSafeSpotList().forEach(tile ->
|
||||
{
|
||||
if (safeSpotPlugin.getSafeSpotList().size() > 0)
|
||||
if (tile != null && tile.getLocalLocation() != null)
|
||||
{
|
||||
safeSpotPlugin.getSafeSpotList().forEach(tile ->
|
||||
final Polygon poly = Perspective.getCanvasTilePoly(client, tile.getLocalLocation());
|
||||
if (poly != null)
|
||||
{
|
||||
if (tile != null && tile.getLocalLocation() != null)
|
||||
{
|
||||
final Polygon poly = Perspective.getCanvasTilePoly(client, tile.getLocalLocation());
|
||||
if (poly != null)
|
||||
{
|
||||
OverlayUtil.renderPolygon(graphics, poly, safeSpotPlugin.getTileColor());
|
||||
}
|
||||
}
|
||||
});
|
||||
OverlayUtil.renderPolygon(graphics, poly, safeSpotPlugin.getTileColor());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -173,16 +173,14 @@ public class SafeSpotPlugin extends Plugin
|
||||
{
|
||||
bit = Objects.requireNonNull(client.getCollisionMaps())[plane].getFlags()[toPoint.getSceneX()][toPoint.getSceneY()];
|
||||
}
|
||||
if (toTile != null && toTile.hasLineOfSightTo(fromTile) && !fromTile.hasLineOfSightTo(toTile))
|
||||
{
|
||||
if (!((bit & CollisionDataFlag.BLOCK_MOVEMENT_OBJECT) == CollisionDataFlag.BLOCK_MOVEMENT_OBJECT ||
|
||||
if (toTile != null && toTile.hasLineOfSightTo(fromTile) && !fromTile.hasLineOfSightTo(toTile) &&
|
||||
(!((bit & CollisionDataFlag.BLOCK_MOVEMENT_OBJECT) == CollisionDataFlag.BLOCK_MOVEMENT_OBJECT ||
|
||||
(bit & CollisionDataFlag.BLOCK_MOVEMENT_FLOOR_DECORATION)
|
||||
== CollisionDataFlag.BLOCK_MOVEMENT_FLOOR_DECORATION ||
|
||||
(bit & CollisionDataFlag.BLOCK_MOVEMENT_FLOOR) == CollisionDataFlag.BLOCK_MOVEMENT_FLOOR ||
|
||||
(bit & CollisionDataFlag.BLOCK_MOVEMENT_FULL) == CollisionDataFlag.BLOCK_MOVEMENT_FULL))
|
||||
{
|
||||
safeSpotList.add(toTile);
|
||||
}
|
||||
(bit & CollisionDataFlag.BLOCK_MOVEMENT_FULL) == CollisionDataFlag.BLOCK_MOVEMENT_FULL)))
|
||||
{
|
||||
safeSpotList.add(toTile);
|
||||
}
|
||||
}
|
||||
return safeSpotList;
|
||||
|
||||
Reference in New Issue
Block a user