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();
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();
if (wasInCrypt && !isInCrypt)
{
stopPrayerDrainTimer();
}
else if (!wasInCrypt && isInCrypt)
{
startPrayerDrainTimer();
}
stopPrayerDrainTimer();
}
else if (!wasInCrypt && isInCrypt)
{
startPrayerDrainTimer();
}
}
}