diff --git a/logic/service/fight/action.go b/logic/service/fight/action.go index eff710e4..3867afe4 100644 --- a/logic/service/fight/action.go +++ b/logic/service/fight/action.go @@ -88,7 +88,12 @@ func (f *FightC) UseSkill(c common.PlayerI, id int32) { ret := &action.SelectSkillAction{ BaseAction: action.NewBaseAction(c.GetInfo().UserID), } - + if f.GetInputByPlayer(c, false).CurrentPet == nil { + return + } + if f.GetInputByPlayer(c, false).CurrentPet.Info.Hp <= 0 { + return + } for _, v := range f.GetInputByPlayer(c, false).CurrentPet.Skills { if v != nil && v.ID == int(id) {