timers: Merge nested if statements

This commit is contained in:
sdburns1998
2019-07-07 21:45:22 +02:00
parent f9c6cd2670
commit 6f7009ae5e

View File

@@ -60,11 +60,11 @@ import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.ConfigChanged;
import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick; import net.runelite.api.events.GameTick;
import net.runelite.api.events.SpotAnimationChanged;
import net.runelite.api.events.ItemContainerChanged; import net.runelite.api.events.ItemContainerChanged;
import net.runelite.api.events.LocalPlayerDeath; import net.runelite.api.events.LocalPlayerDeath;
import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.events.MenuOptionClicked;
import net.runelite.api.events.NpcDespawned; import net.runelite.api.events.NpcDespawned;
import net.runelite.api.events.SpotAnimationChanged;
import net.runelite.api.events.VarbitChanged; import net.runelite.api.events.VarbitChanged;
import net.runelite.api.events.WidgetHiddenChanged; import net.runelite.api.events.WidgetHiddenChanged;
import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.Widget;
@@ -78,41 +78,7 @@ import net.runelite.client.game.SpriteManager;
import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.PluginDescriptor;
import static net.runelite.client.plugins.timers.GameIndicator.VENGEANCE_ACTIVE; import static net.runelite.client.plugins.timers.GameIndicator.VENGEANCE_ACTIVE;
import static net.runelite.client.plugins.timers.GameTimer.ABYSSAL_SIRE_STUN; import static net.runelite.client.plugins.timers.GameTimer.*;
import static net.runelite.client.plugins.timers.GameTimer.ANTIFIRE;
import static net.runelite.client.plugins.timers.GameTimer.ANTIPOISON;
import static net.runelite.client.plugins.timers.GameTimer.ANTIVENOM;
import static net.runelite.client.plugins.timers.GameTimer.BIND;
import static net.runelite.client.plugins.timers.GameTimer.CANNON;
import static net.runelite.client.plugins.timers.GameTimer.CHARGE;
import static net.runelite.client.plugins.timers.GameTimer.DMM_FULLTB;
import static net.runelite.client.plugins.timers.GameTimer.DMM_HALFTB;
import static net.runelite.client.plugins.timers.GameTimer.ENTANGLE;
import static net.runelite.client.plugins.timers.GameTimer.EXANTIFIRE;
import static net.runelite.client.plugins.timers.GameTimer.EXSUPERANTIFIRE;
import static net.runelite.client.plugins.timers.GameTimer.FULLTB;
import static net.runelite.client.plugins.timers.GameTimer.GOD_WARS_ALTAR;
import static net.runelite.client.plugins.timers.GameTimer.HALFBIND;
import static net.runelite.client.plugins.timers.GameTimer.HALFENTANGLE;
import static net.runelite.client.plugins.timers.GameTimer.HALFSNARE;
import static net.runelite.client.plugins.timers.GameTimer.HALFTB;
import static net.runelite.client.plugins.timers.GameTimer.HOME_TELEPORT;
import static net.runelite.client.plugins.timers.GameTimer.ICEBARRAGE;
import static net.runelite.client.plugins.timers.GameTimer.ICEBLITZ;
import static net.runelite.client.plugins.timers.GameTimer.ICEBURST;
import static net.runelite.client.plugins.timers.GameTimer.ICERUSH;
import static net.runelite.client.plugins.timers.GameTimer.IMBUEDHEART;
import static net.runelite.client.plugins.timers.GameTimer.MAGICIMBUE;
import static net.runelite.client.plugins.timers.GameTimer.MINIGAME_TELEPORT;
import static net.runelite.client.plugins.timers.GameTimer.OVERLOAD;
import static net.runelite.client.plugins.timers.GameTimer.OVERLOAD_RAID;
import static net.runelite.client.plugins.timers.GameTimer.PRAYER_ENHANCE;
import static net.runelite.client.plugins.timers.GameTimer.SKULL;
import static net.runelite.client.plugins.timers.GameTimer.SNARE;
import static net.runelite.client.plugins.timers.GameTimer.STAFF_OF_THE_DEAD;
import static net.runelite.client.plugins.timers.GameTimer.STAMINA;
import static net.runelite.client.plugins.timers.GameTimer.SUPERANTIFIRE;
import static net.runelite.client.plugins.timers.GameTimer.VENGEANCE;
import net.runelite.client.ui.overlay.infobox.InfoBoxManager; import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
@PluginDescriptor( @PluginDescriptor(
@@ -677,15 +643,13 @@ public class TimersPlugin extends Plugin
} }
} }
if (freezeTimer != null) if (freezeTimer != null &&
{
// assume movement means unfrozen // assume movement means unfrozen
if (freezeTime != client.getTickCount() freezeTime != client.getTickCount()
&& !currentWorldPoint.equals(lastPoint)) && !currentWorldPoint.equals(lastPoint))
{ {
removeGameTimer(freezeTimer.getTimer()); removeGameTimer(freezeTimer.getTimer());
freezeTimer = null; freezeTimer = null;
}
} }
lastPoint = currentWorldPoint; lastPoint = currentWorldPoint;