Fix bad Forme setting due to integer conversion

This commit is contained in:
Michael Scire
2016-11-22 09:38:50 -08:00
parent 4f61373d8b
commit f1ff610f97

View File

@@ -642,7 +642,7 @@ private void B_Randomize_Click(object sender, EventArgs e)
}
encounter.Species = (uint)species;
}
encounter.Forme = (uint)GetRandomForme((int)encounter.Species);
encounter.Forme = GetRandomForme((int)encounter.Species);
}
}
}
@@ -655,16 +655,16 @@ private void B_Randomize_Click(object sender, EventArgs e)
Util.Alert("Randomized!");
}
public int GetRandomForme(int species)
public uint GetRandomForme(int species)
{
if (Main.SpeciesStat[species].FormeCount > 1)
{
if (Legal.Mega_ORAS.Contains((ushort)species))
if (CHK_MegaForm.Checked)
return (int) rnd32()%Main.SpeciesStat[species].FormeCount; // Slot-Random
return (uint) (rnd32()%Main.SpeciesStat[species].FormeCount); // Slot-Random
else
return 0;
return (int)rnd32() % Main.SpeciesStat[species].FormeCount; // Slot-Random
return (uint)(rnd32() % Main.SpeciesStat[species].FormeCount); // Slot-Random
}
return 0;