From a45cddd3edb78d87cd87db7681018e1e37b2dd91 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 27 May 2019 21:38:04 -0700 Subject: [PATCH] Add missing hax item clamp early return Closes #2281 remove unnecessary "else", and break for visual separation --- PKHeX.Core/Saves/Substructures/Inventory/InventoryPouch.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PKHeX.Core/Saves/Substructures/Inventory/InventoryPouch.cs b/PKHeX.Core/Saves/Substructures/Inventory/InventoryPouch.cs index 2cb854ae1..75e50038a 100644 --- a/PKHeX.Core/Saves/Substructures/Inventory/InventoryPouch.cs +++ b/PKHeX.Core/Saves/Substructures/Inventory/InventoryPouch.cs @@ -195,8 +195,10 @@ public bool IsValidItemAndCount(ITrainerInfo SAV, int itemindex, bool HasNew, bo itemcnt = byte.MaxValue; else if (SAV.Generation >= 3 && itemcnt > ushort.MaxValue) itemcnt = ushort.MaxValue; + return true; } - else if (itemcnt > MaxCount) + + if (itemcnt > MaxCount) { if (itemindex == 797 && itemcnt >= 2) // Edge case when for some reason the item count for Z-Ring was 2 in an unedited save and set 1 after using PKHeX itemcnt = 2;