mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-26 06:24:06 -05:00
Fix box load on uninitialized box load
Closes #2376 probably will be rewritten at a later time; am reworking the slot info messaging for drag/drop/display
This commit is contained in:
@@ -579,7 +579,7 @@ public int Y
|
||||
// Storage
|
||||
public override int CurrentBox
|
||||
{
|
||||
get => Data[Version == GameVersion.HGSS ? GetBoxOffset(BoxCount) : Box - 4];
|
||||
get => (sbyte)Data[Version == GameVersion.HGSS ? GetBoxOffset(BoxCount) : Box - 4];
|
||||
set => Data[Version == GameVersion.HGSS ? GetBoxOffset(BoxCount) : Box - 4] = (byte)value;
|
||||
}
|
||||
|
||||
|
||||
@@ -257,7 +257,10 @@ private void GetBox(object sender, EventArgs e)
|
||||
public void InitializeFromSAV(SaveFile sav)
|
||||
{
|
||||
Editor = new BoxEdit(sav);
|
||||
Editor.LoadBox(sav.CurrentBox);
|
||||
int box = sav.CurrentBox;
|
||||
if ((uint)box >= sav.BoxCount)
|
||||
box = 0;
|
||||
Editor.LoadBox(box);
|
||||
ResetBoxNames(); // Display the Box Names
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user