Safety check

negative species/formestatsindex returns species
This commit is contained in:
Kaphotics 2016-07-04 23:53:15 -07:00
parent 52c87c8c5f
commit f0503540a0

View file

@ -80,9 +80,9 @@ namespace PKHeX
// Data Manipulation // Data Manipulation
public int FormeIndex(int species, int forme) public int FormeIndex(int species, int forme)
{ {
if (forme == 0) // no forme requested if (forme <= 0) // no forme requested
return species; return species;
if (FormStatsIndex == 0) // no formes present if (FormStatsIndex <= 0) // no formes present
return species; return species;
if (forme > FormeCount) // beyond range of species' formes if (forme > FormeCount) // beyond range of species' formes
return species; return species;