mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-24 23:57:12 -05:00
Clamp picnic table accessory counts
This commit is contained in:
parent
af660dd299
commit
b2cbcd5139
|
|
@ -264,6 +264,8 @@ private int GetSuggestedItemCount(ITrainerInfo sav, int item, int requestVal = 1
|
|||
return InventoryPouch8.GetSuggestedCount(Type, item, requestVal);
|
||||
if (sav is not SAV8BS && ItemConverter.IsItemHM((ushort)item, sav.Generation))
|
||||
return 1;
|
||||
if (sav is SAV9SV)
|
||||
return InventoryPouch9.GetSuggestedCount(Type, item, requestVal);
|
||||
return Math.Min(MaxCount, requestVal);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,4 +88,15 @@ public override void SetPouch(Span<byte> data)
|
|||
public static int GetItemOffset(ushort index) => (InventoryItem9.SIZE * index);
|
||||
|
||||
public void ClearItem(Span<byte> data, ushort index) => InventoryItem9.Clear(data, GetItemOffset(index));
|
||||
|
||||
public static int GetSuggestedCount(InventoryType t, int item, int requestVal)
|
||||
{
|
||||
bool pick = item is >= 2334 and <= 2342 || item is >= 2385 and <= 2394;
|
||||
return t switch
|
||||
{
|
||||
// Picnic table accessories are clamped to 1, let actual ingredients and sandwich picks be whatever
|
||||
InventoryType.Ingredients => !pick && item is >= 2311 and <= 2400 ? 1 : requestVal,
|
||||
_ => requestVal,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user