狩猎购买挑战卷

This commit is contained in:
meixiongfeng 2022-11-29 11:15:02 +08:00
parent 809d5d2dc5
commit ddde857f8b

View File

@ -47,6 +47,11 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.HuntingBuyReq) (code
} else {
curByCount = list.BuyCount
}
curByCount += req.Count // 当前需要购买的数量
if this.configure.GetMaxBuyChallengeCount() < curByCount {
code = pb.ErrorCode_HuntingBuyMaxCount
return
}
conf := this.module.configure.GetGlobalConf()
if conf == nil {
code = pb.ErrorCode_ConfigNoFound
@ -88,11 +93,6 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.HuntingBuyReq) (code
list.RecoveryTime = 0
}
mapData["recoveryTime"] = list.RecoveryTime
curByCount += req.Count // 当前需要购买的数量
if this.configure.GetMaxBuyChallengeCount() < curByCount {
code = pb.ErrorCode_HuntingBuyMaxCount
return
}
for i := list.BuyCount + 1; i <= curByCount; i++ {
_cfg := this.configure.GetBuyChallengeCount(i)
@ -109,6 +109,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.HuntingBuyReq) (code
if v.A == v1.A && v.T == v1.T {
v1.N += v.N
bFound = true
break
}
}
if !bFound {