"fix(logic): 修复宠物技能学习校验逻辑并移除冗余战斗效果字段"
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
||||
"blazing/logic/service/pet"
|
||||
"blazing/logic/service/player"
|
||||
"blazing/modules/blazing/model"
|
||||
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
func (h Controller) SetPetSkill(data *pet.ChangeSkillInfo, c *player.Player) (result *pet.ChangeSkillOutInfo, err errorcode.ErrorCode) {
|
||||
@@ -16,6 +18,15 @@ func (h Controller) SetPetSkill(data *pet.ChangeSkillInfo, c *player.Player) (re
|
||||
}
|
||||
c.Info.Coins -= 50
|
||||
_, onpet, ok := c.FindPet(data.CatchTime)
|
||||
if !ok {
|
||||
return result, errorcode.ErrorCodes.ErrSystemBusy
|
||||
}
|
||||
canleaernskill := onpet.GetLevelRangeCanLearningSkills(1, onpet.Level)
|
||||
|
||||
_, ok = lo.Find(canleaernskill, func(item uint32) bool {
|
||||
return item == data.ReplaceSkill
|
||||
})
|
||||
|
||||
if !ok {
|
||||
return result, errorcode.ErrorCodes.ErrSystemBusy
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user