From 27745d5d83fd0fbed2b8a5bf272f46baf1a49c80 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 22 Dec 2022 10:31:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=AF=E6=9C=AC=E5=B0=8F=E6=80=AA=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/enchant/api_challenge.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/enchant/api_challenge.go b/modules/enchant/api_challenge.go index 2e29dd6f4..d066fe9d5 100644 --- a/modules/enchant/api_challenge.go +++ b/modules/enchant/api_challenge.go @@ -54,7 +54,15 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.EnchantChallen if !ok { // 类型校验 enchant.Boss[req.BossType] = 0 } - + // 获取分数 + var score int32 + var format []int32 + score = int32(enchant.Boss[req.BossType]) + for _, v := range cfgData { + if v.ScoreLow >= score && v.ScoreUp >= score { + format = v.Boss + } + } code, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{ Ptype: pb.PlayType_enchant, Title: "", @@ -62,8 +70,9 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.EnchantChallen Leadpos: req.Leadpos, Format: req.Teamids, }, - //Mformat: cfgData.Boss, + Mformat: format, }) + if code != pb.ErrorCode_Success { return }