pileindicators: Merge nested if statements

This commit is contained in:
sdburns1998
2019-07-07 17:40:13 +02:00
parent 4e64b0114e
commit fe8023f8b1

View File

@@ -121,9 +121,7 @@ public class PileIndicatorsPlugin extends Plugin
}
}
if (this.enablePlayers)
{
if ((client.getVar(Varbits.IN_WILDERNESS) > 0 && this.wildyOnlyPlayer) ^ (!this.wildyOnlyPlayer))
if (this.enablePlayers && (client.getVar(Varbits.IN_WILDERNESS) > 0 && this.wildyOnlyPlayer) ^ (!this.wildyOnlyPlayer))
{
for (Player player : client.getPlayers())
{
@@ -133,7 +131,6 @@ public class PileIndicatorsPlugin extends Plugin
}
}
}
}
if (pileList.size() == 0)
{
@@ -145,14 +142,11 @@ public class PileIndicatorsPlugin extends Plugin
ArrayList<Actor> potentialStackArrayList = new ArrayList<>();
for (Actor actorToCompareTo : pileList)
{
if (!potentialStackArrayList.contains(actorToCompareTo))
{
if (actor.getWorldLocation().distanceTo(actorToCompareTo.getWorldLocation()) == 0)
if (!potentialStackArrayList.contains(actorToCompareTo) && actor.getWorldLocation().distanceTo(actorToCompareTo.getWorldLocation()) == 0)
{
potentialStackArrayList.add(actorToCompareTo);
}
}
}
if (potentialStackArrayList.size() >= this.minimumPileSize)
{
outerArrayList.add(potentialStackArrayList);