From b01190cb11cd1ea496610b859ffea76697ee073c Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 19 Feb 2024 10:37:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E6=B6=88=E8=BF=9E=E8=83=9C=E5=8A=A0?= =?UTF-8?q?=E6=88=90=E8=AE=A1=E7=AE=97=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/entertainment/room.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/modules/entertainment/room.go b/modules/entertainment/room.go index 64e52b112..13dff5998 100644 --- a/modules/entertainment/room.go +++ b/modules/entertainment/room.go @@ -756,20 +756,18 @@ func (this *Room) LianShengAdd(liansheng int32) (permillage int32) { result []*cfg.GameConsumeTxtData err error ) + if result, err = this.module.configure.getLianShengReward(); err == nil { - for pos, v := range result { - if len(result) > pos+1 { - if result[pos+1].Winningstreak >= liansheng { // 下一等级小于当前值 - permillage = result[pos].Rewarddata - return - } - } else { - permillage = v.Rewarddata + for i := len(result) - 1; i >= 0; i-- { + if liansheng >= result[i].Winningstreak { + permillage = result[i].Winningstreak + break } } - } - if permillage == 0 { - permillage = 1 + + if permillage == 0 { + permillage = 1000 + } } return }