From 9823de2ac596b594101d4f2fe85f6bc2648a39c7 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 30 Mar 2023 20:05:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0pvp=E9=80=BB=E8=BE=91?= =?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/pvp/module.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/pvp/module.go b/modules/pvp/module.go index ac6119bc0..dfddca3eb 100644 --- a/modules/pvp/module.go +++ b/modules/pvp/module.go @@ -228,7 +228,20 @@ func (this *Pvp) readyTimeOut(task *timewheel.Task, args ...interface{}) { }, battle.RedSession, battle.BlueSession); err != nil { this.Errorln(err) } - go this.practice.ChallengeResults(battle.Id, battle.Red.Uid, battle.Blue.Uid, 0) + + switch battle.Ptype { + case pb.PvpType_friends: + var winside int32 = 0 + if battle.Redformation != nil { + winside = 1 + } + if battle.Blueformation != nil { + winside = 2 + } + go this.practice.ChallengeResults(battle.Id, battle.Red.Uid, battle.Blue.Uid, winside) + break + } + } }