From 1391d464e6e96cf36fa808cd65e20893e6ddf3b6 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 30 Mar 2023 17:50:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=BB=83=E5=8A=9F=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=AE=BE=E7=BD=AE=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/practice/api_practice.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/practice/api_practice.go b/modules/practice/api_practice.go index 8fbb444b2..ce970cffd 100644 --- a/modules/practice/api_practice.go +++ b/modules/practice/api_practice.go @@ -60,9 +60,7 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic code = pb.ErrorCode_ConfigNoFound return } - if code = this.module.ModuleHero.KungFuHero(session, req.Hero, true, ""); code != pb.ErrorCode_Success { - return - } + if req.Teacher != "" { if room.Knapsack[req.Teacher] == 1 { //已经被使用 code = pb.ErrorCode_ReqParameterError @@ -90,7 +88,9 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic pillar.Prop = req.Prop } pillar.Hero = req.Hero - + if code = this.module.ModuleHero.KungFuHero(session, req.Hero, true, ""); code != pb.ErrorCode_Success { + return + } pillar.Start = configure.Now().Unix() if extra >= 0 { pillar.End = configure.Now().Add(time.Minute * (time.Duration(pillarconfigure.PlacementDuration))).Unix()