From 923caeda88f82c61b4889dab58631cf7eb4018d1 Mon Sep 17 00:00:00 2001 From: sdburns1998 Date: Sun, 7 Jul 2019 15:44:15 +0200 Subject: [PATCH] motherlode: Merge nested if statements --- .../motherlode/MotherlodeRocksOverlay.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java index 3fa2aba3dd..6b672967dc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java @@ -97,21 +97,17 @@ class MotherlodeRocksOverlay extends Overlay for (WallObject vein : plugin.getVeins()) { LocalPoint location = vein.getLocalLocation(); - if (localLocation.distanceTo(location) <= MAX_DISTANCE) + if (localLocation.distanceTo(location) <= MAX_DISTANCE && plugin.isUpstairs(localLocation) == plugin.isUpstairs(vein.getLocalLocation())) { - // Only draw veins on the same level - if (plugin.isUpstairs(localLocation) == plugin.isUpstairs(vein.getLocalLocation())) + if (WorldPoint.fromLocal(client, location).equals(plugin.getTargetVeinLocation()) + && plugin.isMining() + && plugin.isShowTargetVein()) { - if (WorldPoint.fromLocal(client, location).equals(plugin.getTargetVeinLocation()) - && plugin.isMining() - && plugin.isShowTargetVein()) - { - renderVein(graphics, vein, true); - } - else - { - renderVein(graphics, vein, false); - } + renderVein(graphics, vein, true); + } + else + { + renderVein(graphics, vein, false); } } }