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