From de6811b85e37f45724cb0cb4110f9bb2c3ee4647 Mon Sep 17 00:00:00 2001 From: Philipp AUER Date: Sun, 24 May 2020 10:03:52 +0200 Subject: [PATCH] battle-engine: fix acupressure crash (#381) - fixes #380 Co-authored-by: SBird --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 5faadb24ee..a5e7f85068 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7001,7 +7001,7 @@ static void Cmd_various(void) u32 statId; do { - statId = (Random() % NUM_BATTLE_STATS) + 1; + statId = (Random() % (NUM_BATTLE_STATS - 1)) + 1; } while (!(bits & gBitTable[statId])); SET_STATCHANGER(statId, 2, FALSE);