Fix ramsav loading logic

Since ramsavloaded was defined when loading (and removed), we need to
define the ramsav before loading it.

Fix for checksum button.
This commit is contained in:
Kurt
2015-10-14 18:52:50 -07:00
parent f6bddf6fce
commit f3ec13965f

View File

@@ -575,8 +575,9 @@ private void openFile(byte[] input, string path, string ext)
if (BitConverter.ToUInt32(input, i) == 0x42454546) { Array.Resize(ref input, 0x70000); break; }
bool o = (input.Length == 0x80000);
try { openMAIN(ram2sav.getMAIN(input), path, (o) ? "ORAS" : "XY", o, true); } catch { return; }
ramsav = (byte[])input.Clone();
try { openMAIN(ram2sav.getMAIN(input), path, (o) ? "ORAS" : "XY", o, true); }
catch { ramsav = null; return; }
}
#endregion
#region Battle Video
@@ -687,7 +688,7 @@ private void openSave(bool oras)
savedited = false;
Menu_ToggleBoxUI.Visible = false;
B_VerifyCHK.Enabled = ramsav != null;
B_VerifyCHK.Enabled = ramsav == null;
DaycareSlot = 0;
setBoxNames(); // Display the Box Names