From 27f9b638d2ac1ddd61f0c5747030a499c03c87cb Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 31 May 2022 19:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E5=8D=A1=EF=BC=9A=E6=AF=8F=E6=97=A5?= =?UTF-8?q?=E6=8C=91=E6=88=98=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/dailyBattleService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game-server/app/services/dailyBattleService.ts b/game-server/app/services/dailyBattleService.ts index c7f1ec6fa..b81b96a69 100644 --- a/game-server/app/services/dailyBattleService.ts +++ b/game-server/app/services/dailyBattleService.ts @@ -72,11 +72,11 @@ export async function checkDaily(roleId: string, battleId: number, inc: number) let curDaily = gameData.daily.find(cur => cur.dailyType == type); if(!curDaily) return { status: -1, resResult: resResult(STATUS.DAILY_TYPE_NOT_FOUND) }; let dailyRecord = await DailyRecordModel.refreshRecord(roleId, type); - let { count = 0, buyCount = 0 } = dailyRecord; + let checkDailyResult = await getDailyNum(dailyRecord); + let { count = 0, buyCount = 0 } = checkDailyResult; if(count + inc > curDaily.timesPerDay + buyCount ) { return { status: -1, resResult: resResult(STATUS.DAILY_TIMES_LACK) } } - let checkDailyResult = await getDailyNum(dailyRecord); return {status: 1, data: {type, ...checkDailyResult }}; }