上传练功状态设置代码优化

This commit is contained in:
liwei1dao 2023-03-30 17:50:41 +08:00
parent 58771acfec
commit 1391d464e6

View File

@ -60,9 +60,7 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
if code = this.module.ModuleHero.KungFuHero(session, req.Hero, true, ""); code != pb.ErrorCode_Success {
return
}
if req.Teacher != "" { if req.Teacher != "" {
if room.Knapsack[req.Teacher] == 1 { //已经被使用 if room.Knapsack[req.Teacher] == 1 { //已经被使用
code = pb.ErrorCode_ReqParameterError code = pb.ErrorCode_ReqParameterError
@ -90,7 +88,9 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic
pillar.Prop = req.Prop pillar.Prop = req.Prop
} }
pillar.Hero = req.Hero pillar.Hero = req.Hero
if code = this.module.ModuleHero.KungFuHero(session, req.Hero, true, ""); code != pb.ErrorCode_Success {
return
}
pillar.Start = configure.Now().Unix() pillar.Start = configure.Now().Unix()
if extra >= 0 { if extra >= 0 {
pillar.End = configure.Now().Add(time.Minute * (time.Duration(pillarconfigure.PlacementDuration))).Unix() pillar.End = configure.Now().Add(time.Minute * (time.Duration(pillarconfigure.PlacementDuration))).Unix()