From 30ff2fa337e0a68e4840fb3b3d7b2e37cbeb8eb1 Mon Sep 17 00:00:00 2001 From: cawtds <38510667+cawtds@users.noreply.github.com> Date: Mon, 22 Jul 2024 17:18:22 +0200 Subject: [PATCH] fix givemon random ivs --- src/script_pokemon_util.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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);