Fix slot deletion

empty value is null for whatever reason, just force the end result to be
0.

https://projectpokemon.org/home/forums/topic/48647-pknx-nintendo-switch-rom-editor-randomizer/?do=findComment&comment=239245
This commit is contained in:
Kurt
2018-12-29 00:26:26 -08:00
parent 58167598f0
commit 5fcc327d86

View File

@@ -119,7 +119,7 @@ public void SaveCurrent()
private void SaveRow(int row, EncounterSlot s)
{
int sp = Array.IndexOf(species, dgv.Rows[row].Cells[1].Value);
int sp = Array.IndexOf(species, dgv.Rows[row].Cells[1].Value ?? species[0]);
string formstr = (dgv.Rows[row].Cells[2].Value ?? 0).ToString();
int.TryParse(formstr, out var form);
string probstr = (dgv.Rows[row].Cells[3].Value ?? 0).ToString();