diff --git a/PKHeX.Core/Items/ItemStorage3Colo.cs b/PKHeX.Core/Items/ItemStorage3Colo.cs index d7849ebef..f64a42ad7 100644 --- a/PKHeX.Core/Items/ItemStorage3Colo.cs +++ b/PKHeX.Core/Items/ItemStorage3Colo.cs @@ -28,7 +28,7 @@ public sealed class ItemStorage3Colo : IItemStorage 540, 541, 542, 546, 547, ]; - public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true; + public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex); public ReadOnlySpan GetItems(InventoryType type) => type switch { diff --git a/PKHeX.Core/Items/ItemStorage3E.cs b/PKHeX.Core/Items/ItemStorage3E.cs index 83ab35ce2..8ef732ea5 100644 --- a/PKHeX.Core/Items/ItemStorage3E.cs +++ b/PKHeX.Core/Items/ItemStorage3E.cs @@ -22,8 +22,7 @@ public sealed class ItemStorage3E : IItemStorage private static readonly ushort[] PCItems = [.. General, .. Berry, .. Balls, .. Machine]; - - public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true; + public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex); public ReadOnlySpan GetItems(InventoryType type) => type switch { diff --git a/PKHeX.Core/Items/ItemStorage3FRLG.cs b/PKHeX.Core/Items/ItemStorage3FRLG.cs index dfc2c81ab..eac5417cb 100644 --- a/PKHeX.Core/Items/ItemStorage3FRLG.cs +++ b/PKHeX.Core/Items/ItemStorage3FRLG.cs @@ -18,7 +18,7 @@ public sealed class ItemStorage3FRLG : IItemStorage 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, ]; - public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true; + public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex); public ReadOnlySpan GetItems(InventoryType type) => type switch { diff --git a/PKHeX.Core/Items/ItemStorage3RS.cs b/PKHeX.Core/Items/ItemStorage3RS.cs index ac5becced..06fe2304c 100644 --- a/PKHeX.Core/Items/ItemStorage3RS.cs +++ b/PKHeX.Core/Items/ItemStorage3RS.cs @@ -60,7 +60,7 @@ public sealed class ItemStorage3RS : IItemStorage private static readonly ushort[] PCItems = [..General, ..Key, .. Berry, ..Balls, ..Machine]; - public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true; + public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex); public ReadOnlySpan GetItems(InventoryType type) => type switch { diff --git a/PKHeX.Core/Items/ItemStorage3XD.cs b/PKHeX.Core/Items/ItemStorage3XD.cs index 529a42721..9956452fb 100644 --- a/PKHeX.Core/Items/ItemStorage3XD.cs +++ b/PKHeX.Core/Items/ItemStorage3XD.cs @@ -59,7 +59,7 @@ public sealed class ItemStorage3XD : IItemStorage 590, 591, 592, 593, ]; - public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true; + public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex); public ReadOnlySpan GetItems(InventoryType type) => type switch { diff --git a/PKHeX.Core/Items/ItemStorage4DP.cs b/PKHeX.Core/Items/ItemStorage4DP.cs index db41205dc..a0442ba1e 100644 --- a/PKHeX.Core/Items/ItemStorage4DP.cs +++ b/PKHeX.Core/Items/ItemStorage4DP.cs @@ -11,7 +11,7 @@ public sealed class ItemStorage4DP : ItemStorage4, IItemStorage public static ushort[] GetAllHeld() => [..GeneralDP, ..Mail, ..Medicine, ..Berry, ..BallsDPPt, ..Battle, ..Machine[..^8]]; - public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true; + public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex); public ReadOnlySpan GetItems(InventoryType type) => type switch { diff --git a/PKHeX.Core/Items/ItemStorage4HGSS.cs b/PKHeX.Core/Items/ItemStorage4HGSS.cs index 70ca5691d..243f4e378 100644 --- a/PKHeX.Core/Items/ItemStorage4HGSS.cs +++ b/PKHeX.Core/Items/ItemStorage4HGSS.cs @@ -27,7 +27,7 @@ public sealed class ItemStorage4HGSS : ItemStorage4, IItemStorage 492, 493, 494, 495, 496, 497, 498, 499, 500, // Apricorn Balls ]; - public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true; + public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex); public ReadOnlySpan GetItems(InventoryType type) => type switch { diff --git a/PKHeX.Core/Items/ItemStorage4Pt.cs b/PKHeX.Core/Items/ItemStorage4Pt.cs index 0ad483041..b01af17fb 100644 --- a/PKHeX.Core/Items/ItemStorage4Pt.cs +++ b/PKHeX.Core/Items/ItemStorage4Pt.cs @@ -20,7 +20,7 @@ public sealed class ItemStorage4Pt : ItemStorage4, IItemStorage public static ushort[] GetAllHeld() => [..GeneralPt, ..Mail, ..Medicine, ..Berry, ..BallsDPPt, ..Battle, ..Machine[..^8]]; - public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true; + public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex); public ReadOnlySpan GetItems(InventoryType type) => type switch { diff --git a/PKHeX.Core/Items/ItemStorage5B2W2.cs b/PKHeX.Core/Items/ItemStorage5B2W2.cs index f1948b8a4..427db7742 100644 --- a/PKHeX.Core/Items/ItemStorage5B2W2.cs +++ b/PKHeX.Core/Items/ItemStorage5B2W2.cs @@ -16,7 +16,7 @@ public sealed class ItemStorage5B2W2 : ItemStorage5, IItemStorage 616, 617, 621, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, ]; - public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true; + public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex); public ReadOnlySpan GetItems(InventoryType type) => type switch { diff --git a/PKHeX.Core/Items/ItemStorage5BW.cs b/PKHeX.Core/Items/ItemStorage5BW.cs index d8de70d1c..4f5b40394 100644 --- a/PKHeX.Core/Items/ItemStorage5BW.cs +++ b/PKHeX.Core/Items/ItemStorage5BW.cs @@ -16,7 +16,7 @@ public sealed class ItemStorage5BW : ItemStorage5, IItemStorage 616, 617, 621, 623, 624, 625, 626, ]; - public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => true; + public bool IsLegal(InventoryType type, int itemIndex, int itemCount) => !Unreleased.Contains((ushort)itemIndex); public ReadOnlySpan GetItems(InventoryType type) => type switch {