上传竞技场代码

This commit is contained in:
liwei1dao 2024-01-26 15:33:41 +08:00
parent 86a782c35b
commit 3f65009669

View File

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