From 072452625a923738b86c7f150972e7b0bfb7a45a Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Mon, 26 Nov 2018 15:12:07 -0800 Subject: [PATCH] timers: Correctly add freeze timer upon frozen while moving When becoming affected by an ice spell, such as Ice Barrage, when moving prior to the effect's start, the previous code had a subtle bug where the freeze timer would be applied in the chat message subscriber, but the `client` would update the player's position before the onGameTick subscriber was executed, meaning any movement on the same tick the player became frozen would be registered as "movement", thus removing that timer. This fix sidesteps that issue by also ensuring that the client's tick is different than the freeze tick, since that value appears to remain unmodified between execution of these two methods. Fixes runelite/runelite#6658 --- .../java/net/runelite/client/plugins/timers/TimersPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index 14f0a39cd8..ca6f1027a4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -521,7 +521,8 @@ public class TimersPlugin extends Plugin if (freezeTimer != null) { // assume movement means unfrozen - if (!currentWorldPoint.equals(lastPoint)) + if (freezeTime != client.getTickCount() + && !currentWorldPoint.equals(lastPoint)) { removeGameTimer(freezeTimer.getTimer()); freezeTimer = null;