refactor(fight): 优化战斗逻辑代码结构,清理冗余代码

This commit is contained in:
1
2025-11-06 14:28:04 +00:00
parent 0dda1f1ea7
commit b8a6aacaa9
4 changed files with 257 additions and 87 deletions

View File

@@ -4,10 +4,11 @@ import (
"blazing/common/data/xmlres"
"blazing/common/socket/errorcode"
"blazing/common/utils"
"blazing/logic/service/pet"
"blazing/logic/service/player"
"github.com/samber/lo"
"blazing/modules/blazing/model"
"github.com/jinzhu/copier"
@@ -187,7 +188,9 @@ func (h Controller) SetPetSkill(data *pet.ChangeSkillInfo, c *player.Player) (re
}
}
onpet.SkillList = lo.UniqBy(onpet.SkillList, func(s model.SkillInfo) int {
return int(s.ID)
})
return &pet.ChangeSkillOutInfo{
CatchTime: data.CatchTime,
}, 0