From da34bdbee41cf75498c4d1afb7829b46be31bfc8 Mon Sep 17 00:00:00 2001 From: gigalh128 Date: Mon, 24 Jul 2023 20:25:44 -0400 Subject: [PATCH] Add missing truncation --- src/ladder.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ladder.ts b/src/ladder.ts index 2761f53..41c10b2 100644 --- a/src/ladder.ts +++ b/src/ladder.ts @@ -46,11 +46,11 @@ export class Ladder { this.rpoffset = 9 * 60 * 60; } getRP() { - const rpnum = ((time() - this.rpoffset) / this.rplen) + 1; + const rpnum = Math.trunc((time() - this.rpoffset) / this.rplen) + 1; return rpnum * this.rplen + this.rpoffset; } nextRP(rp: number) { - const rpnum = (rp / this.rplen); + const rpnum = Math.trunc(rp / this.rplen); return (rpnum + 1) * this.rplen + this.rpoffset; } clearRating(name: string) {