warindicators: Merge nested if statements

This commit is contained in:
sdburns1998
2019-07-07 21:52:34 +02:00
parent 7e178ff57f
commit f98fe21126
2 changed files with 6 additions and 15 deletions

View File

@@ -68,12 +68,9 @@ public class WarIndicatorMiniMapOverlay extends Overlay
String[] callers = plugin.getGetActiveCallers().split(", ");
String[] targets = plugin.getGetTargetedSnipes().split(", ");
if (plugin.isCallerMinimap() && ArrayUtils.contains(callers, actor.getName()))
if (plugin.isCallerMinimap() && ArrayUtils.contains(callers, actor.getName()) && minimapLocation != null)
{
if (minimapLocation != null)
{
OverlayUtil.renderTextLocation(graphics, minimapLocation, name, color);
}
OverlayUtil.renderTextLocation(graphics, minimapLocation, name, color);
}
if (plugin.isSnipeMinimap() && ArrayUtils.contains(targets, actor.getName()))

View File

@@ -73,20 +73,14 @@ public class WarIndicatorOverlay extends Overlay
String[] callers = plugin.getGetActiveCallers().split(", ");
String[] targets = plugin.getGetTargetedSnipes().split(", ");
if (plugin.isCallerTile() && ArrayUtils.contains(callers, actor.getName()))
if (plugin.isCallerTile() && ArrayUtils.contains(callers, actor.getName()) && poly != null)
{
if (poly != null)
{
OverlayUtil.renderPolygon(graphics, poly, color);
}
OverlayUtil.renderPolygon(graphics, poly, color);
}
if (plugin.isSnipeTile() && ArrayUtils.contains(targets, actor.getName()))
if (plugin.isSnipeTile() && ArrayUtils.contains(targets, actor.getName()) && poly != null)
{
if (poly != null)
{
OverlayUtil.renderPolygon(graphics, poly, color);
}
OverlayUtil.renderPolygon(graphics, poly, color);
}
String name = actor.getName().replace('\u00A0', ' ');