Fixed crash when opening SAV_BoxLayout with Gen 4 save

Should fix issue #415
This commit is contained in:
Evan Dixon
2016-11-15 17:31:26 -06:00
parent 78a408944f
commit d6f8a79f1b

View File

@@ -15,11 +15,21 @@ public SAV_BoxLayout(int box)
// Repopulate Wallpaper names
CB_BG.Items.Clear();
if (SAV.Generation == 6)
CB_BG.Items.AddRange(Main.GameStrings.wallpapernames);
else if (SAV.Generation == 7)
CB_BG.Items.AddRange(Main.GameStrings.wallpapernames.Take(16).ToArray());
switch (SAV.Generation)
{
case 4:
case 5:
case 6:
CB_BG.Items.AddRange(Main.GameStrings.wallpapernames);
break;
case 7:
CB_BG.Items.AddRange(Main.GameStrings.wallpapernames.Take(16).ToArray());
break;
default:
Util.Error("Box layout is not supported for this game.");
return;
}
// Go
LB_BoxSelect.Items.Clear();
for (int i = 0; i < SAV.BoxCount; i++)