mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-18 14:28:33 +00:00
Check format 3/4 for setpidnature
This commit is contained in:
parent
78cc0098b3
commit
21e1e6def5
1 changed files with 3 additions and 2 deletions
|
@ -174,9 +174,10 @@ namespace PKHeX.Core
|
||||||
public static void SetNature(this PKM pk, int nature)
|
public static void SetNature(this PKM pk, int nature)
|
||||||
{
|
{
|
||||||
var value = Math.Min((int)Nature.Quirky, Math.Max((int)Nature.Hardy, nature));
|
var value = Math.Min((int)Nature.Quirky, Math.Max((int)Nature.Hardy, nature));
|
||||||
if (pk.Format >= 8)
|
var format = pk.Format;
|
||||||
|
if (format >= 8)
|
||||||
pk.StatNature = value;
|
pk.StatNature = value;
|
||||||
else if (pk.Format <= 4)
|
else if (format is 3 or 4)
|
||||||
pk.SetPIDNature(value);
|
pk.SetPIDNature(value);
|
||||||
else
|
else
|
||||||
pk.Nature = value;
|
pk.Nature = value;
|
||||||
|
|
Loading…
Add table
Reference in a new issue