From 14c8c156c87600911947bd7260457efc3ded00a6 Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Mon, 13 May 2024 15:08:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A2=E7=B4=A2=E6=97=B6,=20=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E5=BE=97=E5=88=B0=E5=88=86=E6=95=B0=E5=A4=A7=E4=BA=8E?= =?UTF-8?q?0=E6=97=B6,=20=E6=89=8D=E6=8F=92=E5=85=A5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/game.controller.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/controllers/game.controller.ts b/src/controllers/game.controller.ts index 03825d6..11d2730 100644 --- a/src/controllers/game.controller.ts +++ b/src/controllers/game.controller.ts @@ -416,15 +416,17 @@ class GameController extends BaseController { if (!saveRes.lastErrorObject.updatedExisting) { throw new ZError(17, 'insufficient tickets.') } - await updateRankScore({ - user: user.id, - score: score, - activity: user.activity, - scoreType: SCORE_GAME_STEP, - scoreParams: { - step: step, - }, - }) + if (score > 0) { + await updateRankScore({ + user: user.id, + score: score, + activity: user.activity, + scoreType: SCORE_GAME_STEP, + scoreParams: { + step: step, + }, + }) + } // batch save chests for (let chest of chests) { await chest.save()