Tweak itemname set to avoid exception

Set the value to (None) & 0 while we're at it, instead of leaving the
row uninitialized.

Thanks Delta Blast Burn!
This commit is contained in:
Kaphotics
2016-09-18 19:43:49 -07:00
parent 6239ee7c58
commit 96188a3e8d

View File

@@ -130,12 +130,15 @@ private void spillBag(DataGridView dgv, int bag)
for (int i = 0; i < pouch.Items.Length; i++)
{
int itemvalue = pouch.Items[i].Index;
try { itemname = itemlist[itemvalue]; }
catch
if (itemvalue >= itemlist.Length)
{
Util.Error("Unknown item detected.", "Item ID: " + itemvalue, "Item is after: " + itemname);
dgv.Rows[i].Cells[0].Value = itemarr[0];
dgv.Rows[i].Cells[1].Value = 0;
continue;
}
itemname = itemlist[itemvalue];
int itemarrayval = Array.IndexOf(itemarr, itemname);
if (itemarrayval == -1)
{