mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-01 19:16:48 -05:00
Simplify setting pk6's to XY with ORAS exclusives
This commit is contained in:
@@ -577,7 +577,7 @@ private void openFile(byte[] input, string path, string ext)
|
||||
bool o = (input.Length == 0x80000);
|
||||
ramsav = (byte[])input.Clone();
|
||||
try { openMAIN(ram2sav.getMAIN(input), path, (o) ? "ORAS" : "XY", o, true); }
|
||||
catch { ramsav = null; return; }
|
||||
catch { ramsav = null; }
|
||||
}
|
||||
#endregion
|
||||
#region Battle Video
|
||||
@@ -2618,20 +2618,14 @@ private void clickSet(object sender, EventArgs e)
|
||||
|
||||
if (!SaveGame.ORAS)
|
||||
{
|
||||
PK6 pk = new PK6(pkxdata);
|
||||
// User Protection
|
||||
bool move1 = BitConverter.ToInt16(pkxdata, 0x5A) > 617;
|
||||
bool move2 = BitConverter.ToInt16(pkxdata, 0x5C) > 617;
|
||||
bool move3 = BitConverter.ToInt16(pkxdata, 0x5E) > 617;
|
||||
bool move4 = BitConverter.ToInt16(pkxdata, 0x60) > 617;
|
||||
bool ability = pkxdata[0x14] > 188;
|
||||
bool item = BitConverter.ToInt16(pkxdata, 0x0A) > 717;
|
||||
string err = "";
|
||||
|
||||
if (move1 || move2 || move3 || move4)
|
||||
if (pk.Moves.Any(m => m > 617))
|
||||
err = "Move does not exist in X/Y.";
|
||||
else if (ability)
|
||||
else if (pk.Ability > 188)
|
||||
err = "Ability does not exist in X/Y.";
|
||||
else if (item)
|
||||
else if (pk.HeldItem > 717)
|
||||
err = "Item does not exist in X/Y.";
|
||||
|
||||
if ((err != "") && Util.Prompt(MessageBoxButtons.YesNo, err, "Continue?") != DialogResult.Yes)
|
||||
|
||||
Reference in New Issue
Block a user