summaryrefslogtreecommitdiff
path: root/src/battle_pyramid.c
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-05-16 12:24:04 -0400
committerGitHub <noreply@github.com>2021-05-16 12:24:04 -0400
commit9e690c07edb2219c6c19fc5869a9558cc9df973d (patch)
tree79e3819ea798c409d5903ae252cc97609eba581c /src/battle_pyramid.c
parentab8318cc79de60413085b104125490cbae344169 (diff)
parenta7e3da2301aa7913f2437fe2152efcec6e96faef (diff)
Merge pull request #1437 from ExpoSeed/bugfixes
Various BUGFIXes and UBFIXes
Diffstat (limited to 'src/battle_pyramid.c')
-rw-r--r--src/battle_pyramid.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c
index a41a80bbb..50efeecb4 100644
--- a/src/battle_pyramid.c
+++ b/src/battle_pyramid.c
@@ -1399,8 +1399,12 @@ void GenerateBattlePyramidWildMon(void)
for (i = 0; i < MAX_MON_MOVES; i++)
SetMonMoveSlot(&gEnemyParty[0], wildMons[id].moves[i], i);
- // BUG: Reading outside the array as lvl was used for mon level instead of frontier lvl mode.
+ // UB: Reading outside the array as lvl was used for mon level instead of frontier lvl mode.
+ #ifndef UBFIX
if (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] >= 140)
+ #else
+ if (gSaveBlock2Ptr->frontier.pyramidWinStreaks[gSaveBlock2Ptr->frontier.lvlMode] >= 140)
+ #endif
{
id = (Random() % 17) + 15;
for (i = 0; i < NUM_STATS; i++)