Minor tweaks

Fix off by one and add a safety check for sav6
This commit is contained in:
Kaphotics
2016-07-24 21:19:08 -07:00
parent cc1621879e
commit 3d0ffabe75
2 changed files with 3 additions and 2 deletions

View File

@@ -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)
{

View File

@@ -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);
}
}
}