npc scene overlay: fix respawn time

This commit is contained in:
Adam
2018-06-04 21:34:08 -04:00
parent 3c82663ae9
commit 7929bf1d5e

View File

@@ -122,7 +122,7 @@ public class NpcSceneOverlay extends Overlay
}
final Instant now = Instant.now();
final double baseTick = (npc.getDiedOnTick() + npc.getRespawnTime()) - client.getTickCount() * ESTIMATED_TICK_LENGTH;
final double baseTick = ((npc.getDiedOnTick() + npc.getRespawnTime()) - client.getTickCount()) * ESTIMATED_TICK_LENGTH;
final double sinceLast = (now.toEpochMilli() - plugin.getLastTickUpdate().toEpochMilli()) / 1000.0;
final double timeLeft = Math.max(0.0, baseTick - sinceLast);
final String timeLeftStr = TIME_LEFT_FORMATTER.format(timeLeft);