diff --git a/modules/arena/api_challengereward.go b/modules/arena/api_challengereward.go index d1ccd7182..013ad88b2 100644 --- a/modules/arena/api_challengereward.go +++ b/modules/arena/api_challengereward.go @@ -111,6 +111,10 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha Isai: false, } + if red.Integral < 0 { + red.Integral = 0 + } + if len(info.Record) > 10 { info.Record = info.Record[1:] } @@ -131,9 +135,13 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha Defend: rival.Defend, Isai: false, } + if bule.Integral < 0 { + bule.Integral = 0 + } if len(rival.Record) > 10 { rival.Record = rival.Record[1:] } + } else { bule = &pb.ArenaPlayer{ Dan: info.Dan, @@ -142,6 +150,9 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha }, Integral: req.Aiintegral, } + if bule.Integral < 0 { + bule.Integral = 0 + } } this.module.modelArena.integralCompute(red, bule, req.Iswin) if !req.Isai {