1
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
昔念
2026-04-19 22:05:33 +08:00
parent 5967414da4
commit fd5341da1a
4 changed files with 46 additions and 42 deletions

View File

@@ -85,15 +85,17 @@ func (h Controller) PlayerShowPet(
return
}
slot, ok := player.FindPetBagSlot(data.CatchTime)
if !ok {
// 仅允许仓库精灵展示:背包中的精灵直接拒绝
if _, ok := player.FindPetBagSlot(data.CatchTime); ok {
return nil, errorcode.ErrorCodes.ErrCannotShowBagPokemon
}
ret := player.Service.Pet.PetInfoOneByCatchTime(data.CatchTime)
if ret == nil {
return nil, errorcode.ErrorCodes.ErrPokemonNotExists
}
currentPet := slot.PetInfoPtr()
if currentPet == nil {
return nil, errorcode.ErrorCodes.ErrPokemonNotExists
}
currentPet := &ret.Data
player.SetPetDisplay(data.Flag, currentPet)
player.GetSpace().RefreshUserInfo(player)