whalewatchers: Merge nested if statements
This commit is contained in:
@@ -98,12 +98,9 @@ public class WhaleWatchersPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onOverlayMenuClicked(OverlayMenuClicked event)
|
public void onOverlayMenuClicked(OverlayMenuClicked event)
|
||||||
{
|
{
|
||||||
if (event.getOverlay().equals(overlay))
|
if (event.getOverlay().equals(overlay) && event.getEntry().getOption().equals("Reset"))
|
||||||
{
|
{
|
||||||
if (event.getEntry().getOption().equals("Reset"))
|
resetDamageCounter();
|
||||||
{
|
|
||||||
resetDamageCounter();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,16 +204,10 @@ public class WhaleWatchersPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onVarbitChanged(VarbitChanged event)
|
public void onVarbitChanged(VarbitChanged event)
|
||||||
{
|
{
|
||||||
if (this.showDamageCounter)
|
if (this.showDamageCounter && client.getVar(VarPlayer.ATTACKING_PLAYER) == -1 && inCombat)
|
||||||
{
|
|
||||||
if (client.getVar(VarPlayer.ATTACKING_PLAYER) == -1)
|
|
||||||
{
|
{
|
||||||
if (inCombat)
|
tickCountdown = 10;
|
||||||
{
|
|
||||||
tickCountdown = 10;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (this.protectItemWarning)
|
if (this.protectItemWarning)
|
||||||
{
|
{
|
||||||
@@ -254,17 +245,14 @@ public class WhaleWatchersPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameTick(GameTick event)
|
public void onGameTick(GameTick event)
|
||||||
{
|
{
|
||||||
if (this.showDamageCounter)
|
if (this.showDamageCounter && tickCountdown > 0 && tickCountdown < 11)
|
||||||
{
|
{
|
||||||
if (tickCountdown > 0 && tickCountdown < 11)
|
tickCountdown--;
|
||||||
|
if (tickCountdown == 1)
|
||||||
{
|
{
|
||||||
tickCountdown--;
|
inCombat = false;
|
||||||
if (tickCountdown == 1)
|
resetDamageCounter();
|
||||||
{
|
return;
|
||||||
inCombat = false;
|
|
||||||
resetDamageCounter();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.smiteableWarning && (client.getVar(Varbits.IN_WILDERNESS) == 1 || isPvpWorld(client.getWorldType())))
|
if (this.smiteableWarning && (client.getVar(Varbits.IN_WILDERNESS) == 1 || isPvpWorld(client.getWorldType())))
|
||||||
|
|||||||
Reference in New Issue
Block a user