This commit is contained in:
@@ -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:]...)
|
||||
|
||||
Reference in New Issue
Block a user