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

This commit is contained in:
昔念
2026-04-22 00:39:41 +08:00
parent b59beed45f
commit a6386daad8
11 changed files with 90 additions and 67 deletions

View File

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