mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-09 04:24:36 -05:00
Database load on invalid party counts
This commit is contained in:
parent
2aed4c3118
commit
b89c4fb17f
|
|
@ -282,18 +282,24 @@ public bool IsPartyAllEggs(params int[] except)
|
|||
return party.Count == party.Where(t => t.Species != 0).Where((t, i) => t.IsEgg || except.Contains(i)).Count();
|
||||
}
|
||||
|
||||
private const int MaxPartyCount = 6;
|
||||
|
||||
public IList<PKM> PartyData
|
||||
{
|
||||
get
|
||||
{
|
||||
PKM[] data = new PKM[PartyCount];
|
||||
var count = PartyCount;
|
||||
if (count > MaxPartyCount)
|
||||
count = MaxPartyCount;
|
||||
|
||||
PKM[] data = new PKM[count];
|
||||
for (int i = 0; i < data.Length; i++)
|
||||
data[i] = GetPartySlot(PartyBuffer, GetPartyOffset(i));
|
||||
return data;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.Count is 0 or > 6)
|
||||
if (value.Count is 0 or > MaxPartyCount)
|
||||
throw new ArgumentException($"Expected 1-6, got {value.Count}");
|
||||
#if DEBUG
|
||||
if (value[0].Species == 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user