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 }