Simplify box bin loading

This commit is contained in:
Michael Scire 2016-09-06 19:40:54 -07:00
parent 8b608389eb
commit b2860ea3de

View file

@ -466,14 +466,7 @@ namespace PKHeX
PKM[] pkms = BoxData;
for (int i = 0; i < pkms.Length; i++)
{
if (Generation == 1)
pkms[i] = new PokemonList1(decryptPKM(pkdata[i]))[0];
else if (Generation == 2)
pkms[i] = new PokemonList2(decryptPKM(pkdata[i]))[0];
else
pkms[i].Data = decryptPKM(pkdata[i]);
}
pkms[i] = getPKM(decryptPKM(pkdata[i]));
BoxData = pkms;
return true;
}
@ -491,14 +484,7 @@ namespace PKHeX
PKM[] pkms = BoxData;
for (int i = 0; i < BoxSlotCount; i++)
{
if (Generation == 1)
pkms[box * BoxSlotCount + i] = new PokemonList1(decryptPKM(pkdata[i]))[0];
else if (Generation == 2)
pkms[box * BoxSlotCount + i] = new PokemonList2(decryptPKM(pkdata[i]))[0];
else
pkms[box * BoxSlotCount + i].Data = decryptPKM(pkdata[i]);
}
pkms[box*BoxSlotCount + i] = getPKM(decryptPKM(pkdata[i]));
BoxData = pkms;
return true;
}