Safety check boxlayout selected index

Closes #380
This commit is contained in:
Kurt
2016-11-11 18:05:51 -08:00
parent a3e47805ef
commit f04d492bce

View File

@@ -51,7 +51,7 @@ public SAV_BoxLayout(int box)
CB_Unlocked.Items.Clear();
for (int i = 0; i < SAV.BoxCount; i++)
CB_Unlocked.Items.Add(i + 1);
CB_Unlocked.SelectedIndex = SAV.BoxesUnlocked;
CB_Unlocked.SelectedIndex = Math.Min(SAV.BoxCount - 1, SAV.BoxesUnlocked);
}
else
{