barrows: Combine nested if statements

This commit is contained in:
sdburns1998
2019-07-07 02:25:26 +02:00
parent 6bd5fe0fe4
commit 6a35e214c2

View File

@@ -289,19 +289,16 @@ public class BarrowsPlugin extends Plugin
ladders.clear(); ladders.clear();
puzzleAnswer = null; puzzleAnswer = null;
} }
else if (event.getGameState() == GameState.LOGGED_IN) else if (event.getGameState() == GameState.LOGGED_IN && client.getLocalPlayer() != null)
{ {
if (client.getLocalPlayer() != null) boolean isInCrypt = isInCrypt();
if (wasInCrypt && !isInCrypt)
{ {
boolean isInCrypt = isInCrypt(); stopPrayerDrainTimer();
if (wasInCrypt && !isInCrypt) }
{ else if (!wasInCrypt && isInCrypt)
stopPrayerDrainTimer(); {
} startPrayerDrainTimer();
else if (!wasInCrypt && isInCrypt)
{
startPrayerDrainTimer();
}
} }
} }
} }