Fix off by 1 error

Adds volcanion back
This commit is contained in:
Kurt
2016-11-19 22:48:12 -08:00
parent 061d8d9bfd
commit dbf9d8dfd5
2 changed files with 7 additions and 5 deletions

View File

@@ -21,12 +21,14 @@ public EggMoveEditor7()
specieslist[0] = movelist[0] = "";
string[] sortedspecies = (string[])specieslist.Clone();
Array.Resize(ref sortedspecies, Main.Config.MaxSpeciesID); Array.Sort(sortedspecies);
Array.Resize(ref sortedspecies, Main.Config.MaxSpeciesID + 1); Array.Sort(sortedspecies);
setupDGV();
var newlist = new List<Util.cbItem>();
for (int i = 1; i < Main.Config.MaxSpeciesID; i++) // add all species
for (int i = 1; i <= Main.Config.MaxSpeciesID; i++) // add all species
newlist.Add(new Util.cbItem { Text = sortedspecies[i], Value = Array.IndexOf(specieslist, sortedspecies[i]) });
for (int i = Main.Config.MaxSpeciesID + 1; i < specieslist.Length; i++) // add all forms
newlist.Add(new Util.cbItem { Text = specieslist[i], Value = i });
CB_Species.DisplayMember = "Text";
CB_Species.ValueMember = "Value";

View File

@@ -21,13 +21,13 @@ public LevelUpEditor7()
specieslist[0] = movelist[0] = "";
string[] sortedspecies = (string[])specieslist.Clone();
Array.Resize(ref sortedspecies, Main.Config.MaxSpeciesID); Array.Sort(sortedspecies);
Array.Resize(ref sortedspecies, Main.Config.MaxSpeciesID + 1); Array.Sort(sortedspecies);
setupDGV();
var newlist = new List<Util.cbItem>();
for (int i = 1; i < Main.Config.MaxSpeciesID; i++) // add all species
for (int i = 1; i <= Main.Config.MaxSpeciesID; i++) // add all species
newlist.Add(new Util.cbItem { Text = sortedspecies[i], Value = Array.IndexOf(specieslist, sortedspecies[i]) });
for (int i = Main.Config.MaxSpeciesID; i < specieslist.Length; i++) // add all forms
for (int i = Main.Config.MaxSpeciesID + 1; i < specieslist.Length; i++) // add all forms
newlist.Add(new Util.cbItem { Text = specieslist[i], Value = i });
CB_Species.DisplayMember = "Text";