mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-20 07:36:26 -05:00
Minor tweaks
Fix off by one and add a safety check for sav6
This commit is contained in:
@@ -646,7 +646,8 @@ public override int getBoxOffset(int box)
|
||||
}
|
||||
public override int getBoxWallpaper(int box)
|
||||
{
|
||||
return 1 + Data[PCBackgrounds + box];
|
||||
int ofs = PCBackgrounds > 0 && PCBackgrounds < Data.Length ? PCBackgrounds : 0;
|
||||
return Data[ofs + box];
|
||||
}
|
||||
public override string getBoxName(int box)
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ private void changeBoxBG(object sender, EventArgs e)
|
||||
if (!editing)
|
||||
SAV.Data[SAV.PCBackgrounds + LB_BoxSelect.SelectedIndex] = (byte)CB_BG.SelectedIndex;
|
||||
|
||||
PAN_BG.BackgroundImage = BoxWallpaper.getWallpaper(SAV, CB_BG.SelectedIndex + 1);
|
||||
PAN_BG.BackgroundImage = BoxWallpaper.getWallpaper(SAV, CB_BG.SelectedIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user