添加武馆练功状态添加
This commit is contained in:
parent
5ec1af1f54
commit
3cf5f9bb3c
@ -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()
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user