1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-04-15 03:22:59 +08:00
parent a58ef20fab
commit 5f47bf0589
7 changed files with 42 additions and 19 deletions

View File

@@ -67,8 +67,9 @@ func (h Controller) GetPetLearnableSkills(
data *GetPetLearnableSkillsInboundInfo,
c *player.Player,
) (result *GetPetLearnableSkillsOutboundInfo, err errorcode.ErrorCode) {
_, currentPet, ok := c.FindPet(data.CatchTime)
if !ok {
slot, ok := c.FindPetBagSlot(data.CatchTime)
currentPet := slot.PetInfoPtr()
if !ok || currentPet == nil {
return nil, errorcode.ErrorCodes.ErrPokemonNotExists
}
@@ -81,8 +82,9 @@ func (h Controller) GetPetLearnableSkills(
func (h Controller) SetPetSkill(data *ChangeSkillInfo, c *player.Player) (result *pet.ChangeSkillOutInfo, err errorcode.ErrorCode) {
const setSkillCost = 50
_, currentPet, ok := c.FindPet(data.CatchTime)
if !ok {
slot, ok := c.FindPetBagSlot(data.CatchTime)
currentPet := slot.PetInfoPtr()
if !ok || currentPet == nil {
return nil, errorcode.ErrorCodes.ErrSystemBusy
}
@@ -147,8 +149,9 @@ func (h Controller) SetPetSkill(data *ChangeSkillInfo, c *player.Player) (result
func (h Controller) SortPetSkills(data *C2S_Skill_Sort, c *player.Player) (result *fight.NullOutboundInfo, err errorcode.ErrorCode) {
const skillSortCost = 50
_, currentPet, ok := c.FindPet(data.CapTm)
if !ok {
slot, ok := c.FindPetBagSlot(data.CapTm)
currentPet := slot.PetInfoPtr()
if !ok || currentPet == nil {
return nil, errorcode.ErrorCodes.ErrPokemonNotExists
}
@@ -205,8 +208,9 @@ func (h Controller) CommitPetSkills(
const setSkillCost = 50
const skillSortCost = 50
_, currentPet, ok := c.FindPet(data.CatchTime)
if !ok {
slot, ok := c.FindPetBagSlot(data.CatchTime)
currentPet := slot.PetInfoPtr()
if !ok || currentPet == nil {
return nil, errorcode.ErrorCodes.ErrPokemonNotExists
}