From f878aed12244483a064a186e552c91cf875930eb Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 9 Oct 2023 15:44:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=80=9A=E5=A5=96=E5=8A=B1=E5=8F=91?= =?UTF-8?q?=E6=94=BE=E6=97=B6=E6=9C=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/stonehenge/api_finish.go | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/modules/stonehenge/api_finish.go b/modules/stonehenge/api_finish.go index 8f6fa626b..6a993b1db 100644 --- a/modules/stonehenge/api_finish.go +++ b/modules/stonehenge/api_finish.go @@ -37,9 +37,19 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.StonehengeFinishR } // 校验是否是通关 - if conf := this.module.configure.GetStageConfByStageid(stone.StageID, stone.CurRoomIndes+1); conf == nil { - stone.Reward[stone.StageID] = true - update["reward"] = stone.Reward + if stone.Rooms.Complete { + if conf := this.module.configure.GetStageConfByStageid(stone.StageID, stone.CurRoomIndes+1); conf == nil { + stone.Reward[stone.StageID] = true + update["reward"] = stone.Reward // 设置关卡通关状态 + if conf := this.module.configure.GetStageConfByStageid(stone.StageID, 1); conf != nil { + if len(conf.FirstReward) > 0 { // 完成关卡 发放当前关奖励 + if errdata, reward = this.module.DispenseAtno(session, conf.FirstReward, true); errdata != nil { + return + } + atno = append(atno, reward...) + } + } + } if conf := this.module.configure.GetStageConfByStageid(stone.StageID, stone.CurRoomIndes); conf != nil { stone.Integral += conf.WeeklyPoint // 发放积分 和奖励 update["integral"] = stone.Integral @@ -49,17 +59,9 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.StonehengeFinishR return } } + } - if stone.Rooms.Complete { // 完成关卡 发放当前关奖励 - if conf := this.module.configure.GetStageConfByStageid(stone.StageID, 1); conf != nil { - if len(conf.FirstReward) > 0 { - if errdata, reward = this.module.DispenseAtno(session, conf.FirstReward, true); errdata != nil { - return - } - atno = append(atno, reward...) - } - } - } + stone.StageID = 0 update["stageID"] = stone.StageID stone.CurRoomIndes = 0