From 3157c4d41acbceb3909b2b163fb2bce9b792663b Mon Sep 17 00:00:00 2001 From: xinian Date: Thu, 26 Feb 2026 17:21:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=BB=91=E6=9A=97?= =?UTF-8?q?=E4=BC=A0=E9=80=81=E9=97=A8=E6=89=93=E5=BC=80=E6=97=B6boss?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E5=AF=BC=E8=87=B4=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/controller/fight_塔.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/logic/controller/fight_塔.go b/logic/controller/fight_塔.go index b221c2d8..f4e52e02 100644 --- a/logic/controller/fight_塔.go +++ b/logic/controller/fight_塔.go @@ -24,14 +24,15 @@ func (h Controller) FreshOpen(data *fight.C2S_OPEN_DARKPORTAL, c *player.Player) c.Info.CurrentFreshStage = utils.Max(c.Info.CurrentFreshStage, 1) c.Info.CurrentStage = utils.Max(c.Info.CurrentStage, 1) boss := service.NewTower110Service().Boss(uint32(data.Level)) + if len(boss) == 0 { + return nil, errorcode.ErrorCodes.ErrPokemonNotExists + } + if len(boss[0].BossIds) == 0 { + return nil, errorcode.ErrorCodes.ErrPokemonNotExists + } result = &fight.S2C_OPEN_DARKPORTAL{} r := service.NewBossService().Get(boss[0].BossIds[0]) result.CurBossID = uint32(r[0].MonID) - // for _, v := range r { - // r := service.NewBossService().Get(boss.BossIds[0]) - // result.CurBossID = uint32(r.MonID) - - // } c.CurDark = uint32(data.Level) defer c.GetSpace().LeaveMap(c) @@ -81,7 +82,7 @@ func (h Controller) FreshChoiceFightLevel(data *fight.C2S_FRESH_CHOICE_FIGHT_LEV //next := service.NewTower600Service().Boss(c.Info.CurrentFreshStage + 1) } - if len(boss[0].BossIds) != 0 { + if len(boss) != 0 && len(boss[0].BossIds) != 0 { //单节点,取获取到的一个,然后因为不是剧情,所以只有一层 r := service.NewBossService().Get(boss[0].BossIds[0]) for _, v := range r {