From f02afc134b206b82bd5c73885d0ee9d8855df90a Mon Sep 17 00:00:00 2001 From: SphericalIce Date: Thu, 7 Jan 2021 22:34:57 +0000 Subject: [PATCH] Use the correct constant for max-IV masks --- src/pokemon.c | 12 ++++++------ 1 file 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: