mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-30 05:27:19 -05:00
Loosen restriction on party set (quantity)
Empty array being set is a legitimate write; properly clears the party data.
This commit is contained in:
@@ -197,12 +197,9 @@ public IList<PKM> PartyData
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.Count is 0 or > MaxPartyCount)
|
||||
throw new ArgumentOutOfRangeException(nameof(value), $"Expected 1-6, got {value.Count}");
|
||||
#if DEBUG
|
||||
if (value[0].Species == 0)
|
||||
System.Diagnostics.Debug.WriteLine($"Empty first slot, received {value.Count}.");
|
||||
#endif
|
||||
if (value.Count > MaxPartyCount)
|
||||
throw new ArgumentOutOfRangeException(nameof(value), $"Expected 0-6, got {value.Count}");
|
||||
|
||||
int ctr = 0;
|
||||
foreach (var exist in value.Where(pk => pk.Species != 0))
|
||||
SetPartySlotAtIndex(exist, ctr++);
|
||||
|
||||
Reference in New Issue
Block a user