探索时, 只有得到分数大于0时, 才插入数据

This commit is contained in:
CounterFire2023 2024-05-13 15:08:09 +08:00
parent 604289fd5e
commit 14c8c156c8

View File

@ -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()