From feb2a651f6aa51749bb5a303e7708d8452530e2e Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Wed, 5 Jan 2022 01:13:11 -0500 Subject: [PATCH] fix tiem compression --- src/Exploits/loops.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Exploits/loops.ts b/src/Exploits/loops.ts index 4e066849c..e976ee46e 100644 --- a/src/Exploits/loops.ts +++ b/src/Exploits/loops.ts @@ -13,20 +13,22 @@ function tampering(): void { } function timeCompression(): void { + const timer = 1000 * 15; if (Player.exploits.includes(Exploit.TimeCompression)) return; // Time compression - let last = new Date().getTime(); + let last = performance.now(); function minute(): void { - const now = new Date().getTime(); + const now = performance.now(); + console.log(now - last); if (now - last < 500) { // time has been compressed. Player.giveExploit(Exploit.TimeCompression); return; } last = now; - window.setTimeout(minute, 1000 * 60); + window.setTimeout(minute, timer); } - window.setTimeout(minute, 1000 * 60); + window.setTimeout(minute, timer); } export function startExploits(): void {