Merge pull request #6244 from deathbeam/idle-notifier-fixes
Properly update last action times in Idle Notifier
This commit is contained in:
@@ -214,19 +214,23 @@ public class IdleNotifierPlugin extends Plugin
|
||||
case SAND_COLLECTION:
|
||||
resetTimers();
|
||||
lastAnimation = animation;
|
||||
lastAnimating = Instant.now();
|
||||
break;
|
||||
case MAGIC_LUNAR_SHARED:
|
||||
if (graphic == GraphicID.BAKE_PIE)
|
||||
{
|
||||
resetTimers();
|
||||
lastAnimation = animation;
|
||||
lastAnimating = Instant.now();
|
||||
break;
|
||||
}
|
||||
case IDLE:
|
||||
lastAnimating = Instant.now();
|
||||
break;
|
||||
default:
|
||||
// On unknown animation simply assume the animation is invalid and dont throw notification
|
||||
lastAnimation = IDLE;
|
||||
lastAnimating = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,6 +250,10 @@ public class IdleNotifierPlugin extends Plugin
|
||||
{
|
||||
lastInteract = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastInteracting = Instant.now();
|
||||
}
|
||||
|
||||
final boolean isNpc = target instanceof NPC;
|
||||
|
||||
@@ -264,6 +272,7 @@ public class IdleNotifierPlugin extends Plugin
|
||||
// Player is most likely in combat with attack-able NPC
|
||||
resetTimers();
|
||||
lastInteract = target;
|
||||
lastInteracting = Instant.now();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,7 +456,9 @@ public class IdleNotifierPlugin extends Plugin
|
||||
|
||||
if (interact == null)
|
||||
{
|
||||
if (lastInteracting != null && Instant.now().compareTo(lastInteracting.plus(waitDuration)) >= 0)
|
||||
if (lastInteracting != null
|
||||
&& Instant.now().compareTo(lastInteracting.plus(waitDuration)) >= 0
|
||||
&& lastCombatCountdown == 0)
|
||||
{
|
||||
lastInteract = null;
|
||||
lastInteracting = null;
|
||||
@@ -553,9 +564,6 @@ public class IdleNotifierPlugin extends Plugin
|
||||
{
|
||||
final Player local = client.getLocalPlayer();
|
||||
|
||||
// Reset combat idle timer
|
||||
lastCombatCountdown = 0;
|
||||
|
||||
// Reset animation idle timer
|
||||
lastAnimating = null;
|
||||
if (client.getGameState() == GameState.LOGIN_SCREEN || local == null || local.getAnimation() != lastAnimation)
|
||||
|
||||
Reference in New Issue
Block a user