From 3cf5f9bb3c98e64238687e7350dd1ffdbdcad4a2 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 24 Aug 2022 17:44:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=AD=A6=E9=A6=86=E7=BB=83?= =?UTF-8?q?=E5=8A=9F=E7=8A=B6=E6=80=81=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/martialhall/api_practice.go | 7 +++---- modules/martialhall/api_receive.go | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/martialhall/api_practice.go b/modules/martialhall/api_practice.go index c75077060..ffde2c1d5 100644 --- a/modules/martialhall/api_practice.go +++ b/modules/martialhall/api_practice.go @@ -70,10 +70,6 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.MartialhallPrac code = pb.ErrorCode_MartialhallInUse return } - - if _, code = this.module.ModuleHero.GetHeroByObjID(session.GetUserId(), req.Hero); code != pb.ErrorCode_Success { - return - } var sale = make([]*cfg.Gameatn, 0) for _, v := range mdata.Deplete { sale = append(sale, &cfg.Gameatn{ @@ -85,6 +81,9 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.MartialhallPrac if code = this.module.ConsumeRes(session, sale, true); code != pb.ErrorCode_Success { return } + if code = this.module.ModuleHero.KungFuHero(session, req.Hero, true); code != pb.ErrorCode_Success { + return + } pillar.State = pb.PillarState_Useing pillar.Hero = req.Hero pillar.Start = time.Now().Unix() diff --git a/modules/martialhall/api_receive.go b/modules/martialhall/api_receive.go index 5c950302a..edc653f59 100644 --- a/modules/martialhall/api_receive.go +++ b/modules/martialhall/api_receive.go @@ -66,6 +66,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.MartialhallRecei if code = this.module.ModuleHero.AddHeroExp(session, pillar.Hero, pillar.Reward); code != pb.ErrorCode_Success { return } + if code = this.module.ModuleHero.KungFuHero(session, pillar.Hero, false); code != pb.ErrorCode_Success { + return + } pillar.Hero = "" pillar.State = pb.PillarState_NoUse