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:
Kurt 2017-06-13 22:14:17 -07:00
parent 2979c4f7ec
commit b8069184a2

View file

@ -197,7 +197,6 @@ namespace PKHeX.Core
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 @@ namespace PKHeX.Core
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;