mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 00:37:11 +00:00
Add drop mysterygift into box slot
Converts to pkm (pgt/pcd -> pk4, etc), then is attempted to convert to the format of the save file.
This commit is contained in:
parent
b4a622e784
commit
ea83159370
1 changed files with 4 additions and 2 deletions
|
@ -3326,11 +3326,13 @@ namespace PKHeX
|
|||
if (files.Length <= 0)
|
||||
return;
|
||||
string file = files[0];
|
||||
if (!PKX.getIsPKM(new FileInfo(file).Length))
|
||||
FileInfo fi = new FileInfo(file);
|
||||
if (!PKX.getIsPKM(fi.Length))
|
||||
{ openQuick(file); return; }
|
||||
|
||||
byte[] data = File.ReadAllBytes(file);
|
||||
PKM temp = PKMConverter.getPKMfromBytes(data);
|
||||
MysteryGift mg = MysteryGift.getMysteryGift(data, fi.Extension);
|
||||
PKM temp = mg != null ? mg.convertToPKM(SAV) : PKMConverter.getPKMfromBytes(data);
|
||||
string c;
|
||||
|
||||
PKM pk = PKMConverter.convertToFormat(temp, SAV.Generation, out c);
|
||||
|
|
Loading…
Reference in a new issue