From b98daf11fa5a018eb600e5c83994254f85babc57 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 14 Sep 2023 14:23:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=88=AC=E5=A1=94=E5=89=8D=E7=BD=AE=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/robot/modulerobot_pagoda.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/robot/modulerobot_pagoda.go b/modules/robot/modulerobot_pagoda.go index 765d9b78b..16b888b4e 100644 --- a/modules/robot/modulerobot_pagoda.go +++ b/modules/robot/modulerobot_pagoda.go @@ -15,7 +15,7 @@ import ( type ModuleRobot_Pagoda struct { pagoda *pb.DBPagoda _mapPagoda map[int32]*cfg.GamePagodaData - //mainline *ModuleRobot_MainLine + mainline *ModuleRobot_MainLine } func (this *ModuleRobot_Pagoda) Init() (err error) { @@ -33,7 +33,7 @@ func (this *ModuleRobot_Pagoda) Init() (err error) { } } - //this.mainline = robot.GetModule(comm.ModuleMainline).(*ModuleRobot_MainLine) + // return } @@ -71,18 +71,20 @@ func (this *ModuleRobot_Pagoda) DoPipeline(robot IRobot) (err error) { ) heromodule := robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero) heros := heromodule.getbattlehero() + + this.mainline = robot.GetModule(comm.ModuleMainline).(*ModuleRobot_MainLine) this.pagoda.PagodaId += 1 // 校验能不能打 if c, e := this.getPagodaDataById(this.pagoda.PagodaId); e != nil { // 参数有误 return } else { if c.Unlock != 0 { - this.pagoda.PagodaId -= 1 + if _, ok := this.mainline.info.Level[c.Unlock]; !ok { + return + } } } - if this.pagoda.PagodaId == 0 { - this.pagoda.PagodaId = 1 - } + if resp, errdata = robot.SendMessage("pagoda", "challenge", &pb.PagodaChallengeReq{ Cid: +1, Battle: &pb.BattleFormation{