From 455952d877f62d8edcc36903e1cceadf42c140c1 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 2 Sep 2022 17:24:07 +0800 Subject: [PATCH] =?UTF-8?q?viking=20boss=E7=B1=BB=E5=9E=8B=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/viking/api_challenge.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/viking/api_challenge.go b/modules/viking/api_challenge.go index 5f6cd82df..72c46f67c 100644 --- a/modules/viking/api_challenge.go +++ b/modules/viking/api_challenge.go @@ -41,18 +41,20 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng code = pb.ErrorCode_ConfigNoFound return } - if value, ok := viking.Boos[req.BossType]; !ok { // 类型校验 - code = pb.ErrorCode_VikingBoosType - return - } else { - if value < req.Difficulty { - if value+1 != req.Difficulty { - code = pb.ErrorCode_VikingLvErr - return + // 类型校验 + boosData := this.configure.GetVikingBossConfigData(req.BossType, req.Difficulty) + if boosData != nil { + if value, ok := viking.Boos[req.BossType]; !ok { // 类型校验 + viking.Boos[req.BossType] = 0 + if value < req.Difficulty { + if value+1 != req.Difficulty { + code = pb.ErrorCode_VikingLvErr + return + } + newChallenge = true + } else { // 挑战历史 + newChallenge = false } - newChallenge = true - } else { // 挑战历史 - newChallenge = false } }