From 65d846852058d1ddd8d2ea790fc54f8f3ffad411 Mon Sep 17 00:00:00 2001 From: xinian Date: Sat, 14 Mar 2026 20:02:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=88=98=E6=96=97?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=9A=84=E6=8A=80=E8=83=BD=E5=92=8C?= =?UTF-8?q?=E7=89=A9=E5=93=81=E4=BD=BF=E7=94=A8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/controller/fight_base.go | 6 ++++-- logic/service/fight/action.go | 6 +++++- logic/service/fight/fightc.go | 10 +++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/logic/controller/fight_base.go b/logic/controller/fight_base.go index 9846e1fb..25d74e04 100644 --- a/logic/controller/fight_base.go +++ b/logic/controller/fight_base.go @@ -61,7 +61,8 @@ func (h Controller) Capture(data *fight.CatchMonsterInboundInfo, c *player.Playe } if c.GetSpace().IsTime { if data.CapsuleId < 300009 { - return nil, errorcode.ErrorCodes.ErrCannotPerformAction + go c.FightC.UseSkill(c, 0) + return nil, -1 } } go c.FightC.Capture(c, data.CapsuleId) @@ -84,9 +85,10 @@ func (h Controller) UsePetItemInboundInfo(data *fight.UsePetItemInboundInfo, c * } if c.GetSpace().IsTime { if data.ItemId < 300009 { - return nil, errorcode.ErrorCodes.ErrCannotPerformAction + go c.FightC.UseSkill(c, 0) } } + go c.FightC.UseItem(c, data.CatchTime, data.ItemId) return nil, -1 } diff --git a/logic/service/fight/action.go b/logic/service/fight/action.go index 92015558..9b6d2d2a 100644 --- a/logic/service/fight/action.go +++ b/logic/service/fight/action.go @@ -151,7 +151,11 @@ func (f *FightC) UseItem(c common.PlayerI, cacthid, itemid uint32) { return } - + +if f.Info.Mode== info.BattleMode.PET_MELEE { + go f.UseSkill(c, 0) + return +} select { case f.actionChan <- &action.UseItemAction{BaseAction: action.NewBaseAction(c.GetInfo().UserID), ItemID: itemid, CacthTime: cacthid}: // 发送成功,可选记录日志 diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index 9a953dac..816a0d56 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -330,12 +330,12 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) }) f.Switch = make(map[uint32]*action.ActiveSwitchAction) if f.closefight && f.Info.Mode == info.BattleMode.PET_MELEE { - f.Broadcast(func(fighter *input.Input) { - if fighter.UserID != f.WinnerId { - fighter.Player.SendPackCmd(2505, &attackValueResult) - } + // f.Broadcast(func(fighter *input.Input) { + // if fighter.UserID != f.WinnerId { + // fighter.Player.SendPackCmd(2505, &attackValueResult) + // } - }) + // }) return } f.Broadcast(func(fighter *input.Input) {