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

This commit is contained in:
xinian
2026-02-10 22:09:15 +08:00
committed by cnb
parent ab1445510a
commit a5485de510
12 changed files with 41 additions and 50 deletions

View File

@@ -123,7 +123,10 @@ func (h Controller) TogglePetBagWarehouse(
index, pet, ok := player.FindPet(data.CatchTime)
if ok {
// ========== 新增index合法性校验 ==========
if index < 0 || index >= len(player.Info.PetList) {
return result, errorcode.ErrorCodes.ErrSystemError
}
player.Service.Pet.UPdate(*pet)
player.Info.PetList = append(player.Info.PetList[:index], player.Info.PetList[index+1:]...)