summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSphericalIce <sphericalice@outlook.com>2021-01-07 22:34:57 +0000
committerSphericalIce <sphericalice@outlook.com>2021-01-07 22:34:57 +0000
commitf02afc134b206b82bd5c73885d0ee9d8855df90a (patch)
tree1c730449a2b91fd05dba577489814ca6faa6892a
parent3c2a33b9b25b3bba33c29a10e66d5256b10c537d (diff)
Use the correct constant for max-IV masks
-rw-r--r--src/pokemon.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pokemon.c b/src/pokemon.c
index e3d5dfd97..5bccef907 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -4314,12 +4314,12 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
case MON_DATA_IVS:
{
u32 ivs = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
- substruct3->hpIV = ivs & MAX_PER_STAT_IVS;
- substruct3->attackIV = (ivs >> 5) & MAX_PER_STAT_IVS;
- substruct3->defenseIV = (ivs >> 10) & MAX_PER_STAT_IVS;
- substruct3->speedIV = (ivs >> 15) & MAX_PER_STAT_IVS;
- substruct3->spAttackIV = (ivs >> 20) & MAX_PER_STAT_IVS;
- substruct3->spDefenseIV = (ivs >> 25) & MAX_PER_STAT_IVS;
+ substruct3->hpIV = ivs & MAX_IV_MASK;
+ substruct3->attackIV = (ivs >> 5) & MAX_IV_MASK;
+ substruct3->defenseIV = (ivs >> 10) & MAX_IV_MASK;
+ substruct3->speedIV = (ivs >> 15) & MAX_IV_MASK;
+ substruct3->spAttackIV = (ivs >> 20) & MAX_IV_MASK;
+ substruct3->spDefenseIV = (ivs >> 25) & MAX_IV_MASK;
break;
}
default: