mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-14 06:35:13 -05:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user