diff --git a/src/script_pokemon_util.c b/src/script_pokemon_util.c index 31e40fa31a6f..86eed1914372 100644 --- a/src/script_pokemon_util.c +++ b/src/script_pokemon_util.c @@ -446,12 +446,12 @@ void ScrCmd_givemon(struct ScriptContext *ctx) u8 speedEv = PARSE_FLAG(8, 0); u8 spAtkEv = PARSE_FLAG(9, 0); u8 spDefEv = PARSE_FLAG(10, 0); - u8 hpIv = PARSE_FLAG(11, Random() % MAX_PER_STAT_IVS + 1); - u8 atkIv = PARSE_FLAG(12, Random() % MAX_PER_STAT_IVS + 1); - u8 defIv = PARSE_FLAG(13, Random() % MAX_PER_STAT_IVS + 1); - u8 speedIv = PARSE_FLAG(14, Random() % MAX_PER_STAT_IVS + 1); - u8 spAtkIv = PARSE_FLAG(15, Random() % MAX_PER_STAT_IVS + 1); - u8 spDefIv = PARSE_FLAG(16, Random() % MAX_PER_STAT_IVS + 1); + u8 hpIv = PARSE_FLAG(11, Random() % (MAX_PER_STAT_IVS + 1)); + u8 atkIv = PARSE_FLAG(12, Random() % (MAX_PER_STAT_IVS + 1)); + u8 defIv = PARSE_FLAG(13, Random() % (MAX_PER_STAT_IVS + 1)); + u8 speedIv = PARSE_FLAG(14, Random() % (MAX_PER_STAT_IVS + 1)); + u8 spAtkIv = PARSE_FLAG(15, Random() % (MAX_PER_STAT_IVS + 1)); + u8 spDefIv = PARSE_FLAG(16, Random() % (MAX_PER_STAT_IVS + 1)); u16 move1 = PARSE_FLAG(17, MOVE_NONE); u16 move2 = PARSE_FLAG(18, MOVE_NONE); u16 move3 = PARSE_FLAG(19, MOVE_NONE);