mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-28 23:18:48 -05:00
Fix partycount setting for gen5
only update the party count when appropriate species present=>only update if below no species present=>only update if above Closes #1224
This commit is contained in:
@@ -197,7 +197,6 @@ public PKM[] PartyData
|
||||
|
||||
PKM[] newParty = value.Where(pk => pk.Species != 0).ToArray();
|
||||
|
||||
PartyCount = newParty.Length;
|
||||
Array.Resize(ref newParty, 6);
|
||||
|
||||
for (int i = PartyCount; i < newParty.Length; i++)
|
||||
@@ -481,8 +480,16 @@ public void setPartySlot(PKM pkm, int offset, bool? trade = null, bool? dex = nu
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
if (getPartyOffset(i) == offset)
|
||||
if (PartyCount <= i)
|
||||
PartyCount = i + 1;
|
||||
{
|
||||
if (pkm.Species != 0)
|
||||
{
|
||||
if (PartyCount <= i)
|
||||
PartyCount = i + 1;
|
||||
}
|
||||
else if (PartyCount > i)
|
||||
PartyCount = i;
|
||||
break;
|
||||
}
|
||||
|
||||
setData(pkm.EncryptedPartyData, offset);
|
||||
Edited = true;
|
||||
|
||||
Reference in New Issue
Block a user