Closed mrgriffin closed 2 years ago
BattleResults defines u8 catchAttempts[11];, but battle_script_commands.c does this:
BattleResults
u8 catchAttempts[11];
battle_script_commands.c
gBattleResults.catchAttempts[gLastUsedItem - ITEM_ULTRA_BALL]++;
Which probably reads & writes out of bounds now that there are more balls? I think the fix is u8 catchAttempts[LAST_BALL - ITEM_ULTRA_BALL + 1];?
u8 catchAttempts[LAST_BALL - ITEM_ULTRA_BALL + 1];
Also, caughtMonBall:4 in the same structure must be losing information for balls > 15.
caughtMonBall:4
BattleResults
definesu8 catchAttempts[11];
, butbattle_script_commands.c
does this:Which probably reads & writes out of bounds now that there are more balls? I think the fix is
u8 catchAttempts[LAST_BALL - ITEM_ULTRA_BALL + 1];
?