mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-12 06:37:20 -05:00
Bounds check ability requested
no longer exception's on RefreshAbility(negative number)
This commit is contained in:
parent
6b506957c9
commit
fc4ba1df35
|
|
@ -85,7 +85,7 @@ public int GetGender(int gender, PersonalInfo pkPersonalInfo)
|
|||
|
||||
public int GetAbility(int abilityType, PersonalInfo pkPersonalInfo)
|
||||
{
|
||||
if (abilityType < 3)
|
||||
if ((uint)abilityType < 3)
|
||||
return abilityType;
|
||||
|
||||
var abils = pkPersonalInfo.Abilities;
|
||||
|
|
|
|||
|
|
@ -756,7 +756,7 @@ public void RefreshAbility(int n)
|
|||
{
|
||||
AbilityNumber = 1 << n;
|
||||
int[] abilities = PersonalInfo.Abilities;
|
||||
if (n < abilities.Length)
|
||||
if ((uint)n < abilities.Length)
|
||||
{
|
||||
if (abilities[n] == abilities[0])
|
||||
n = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user