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 } }