Changed how idle checks in combat

IdleNotifier now saves last opponent to accurately determinte combat status
This commit is contained in:
Cameron Moberg
2018-01-21 18:36:58 -06:00
committed by Adam
parent 7d5e0ff389
commit 3fa6ceffb8

View File

@@ -127,6 +127,7 @@ public class IdleNotifierPlugin extends Plugin
@Inject @Inject
IdleNotifierConfig config; IdleNotifierConfig config;
private Actor lastOpponent;
private Instant lastAnimating; private Instant lastAnimating;
private Instant lastInteracting; private Instant lastInteracting;
private Instant lastHitpoints; private Instant lastHitpoints;
@@ -272,6 +273,15 @@ public class IdleNotifierPlugin extends Plugin
&& !isPlayer && !isPlayer
&& opponent.getCombatLevel() > 0 && opponent.getCombatLevel() > 0
&& opponent.getHealth() != -1) && opponent.getHealth() != -1)
{
lastOpponent = opponent;
}
else if (opponent == null)
{
lastOpponent = null;
}
if (lastOpponent != null && opponent == lastOpponent)
{ {
lastInteracting = Instant.now(); lastInteracting = Instant.now();
} }