From 3f650096699edddf290848e7184e252a18d65f43 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 26 Jan 2024 15:33:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=AB=9E=E6=8A=80=E5=9C=BA?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/arena/api_challengereward.go | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 {