From 2c7b354f456c1a6c3979ba2ec885127fdfb46c86 Mon Sep 17 00:00:00 2001 From: ImSoZRious <30285202+ImSoZRious@users.noreply.github.com> Date: Sun, 31 Mar 2024 13:02:15 +0700 Subject: [PATCH] fix: negative --- apps/server/src/models/history.model.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/src/models/history.model.ts b/apps/server/src/models/history.model.ts index e9f33e8..269170c 100644 --- a/apps/server/src/models/history.model.ts +++ b/apps/server/src/models/history.model.ts @@ -68,7 +68,7 @@ export class GameHistoryRepository { if (k !== `game::${game_id}::${key}`) { const kTotal = parseInt((await this.redis.get(k)) || '0') if (kTotal > total - vote) { - this.redis.decrBy(k, Math.round((kTotal - total + vote) * 0.1)) + this.redis.decrBy(k, Math.floor((kTotal - total + vote) * 0.1)) } } })