Changed how idle checks in combat
IdleNotifier now saves last opponent to accurately determinte combat status
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user