条件判断

This commit is contained in:
meixiongfeng 2023-03-31 21:42:54 +08:00
parent a8a900523b
commit 9b0ae604f7
2 changed files with 5 additions and 5 deletions

View File

@ -39,9 +39,9 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
return return
} }
if v, ok := pagoda.Data[req.Cid]; !ok { if v, ok := pagoda.Data[conf.Tab]; !ok {
if conf.LayerNum == 1 { if conf.LayerNum == 1 {
pagoda.Data[req.Cid] = 0 pagoda.Data[conf.Tab] = 0
} else { } else {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配 code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return return

View File

@ -47,9 +47,9 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
return return
} }
if v, ok := pagoda.Data[req.Cid]; !ok { if v, ok := pagoda.Data[conf.Tab]; !ok {
if conf.LayerNum == 1 { if conf.LayerNum == 1 {
pagoda.Data[req.Cid] = 0 pagoda.Data[conf.Tab] = 0
} else { } else {
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配 code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
return return
@ -86,7 +86,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
} }
} }
pagoda.Data[req.Cid] += 1 pagoda.Data[conf.Tab] += 1
mapData["pagodaId"] = pagoda.PagodaId mapData["pagodaId"] = pagoda.PagodaId
mapData["type"] = pagoda.Type mapData["type"] = pagoda.Type