summaryrefslogtreecommitdiff
path: root/src/battle_pyramid.c
diff options
context:
space:
mode:
authorluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-06-01 20:40:27 -0400
committerluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2021-06-01 20:40:27 -0400
commitf0b41debc35c2084aad6d369eab11a2d2df4ab44 (patch)
tree9b720ab0b617fa207051efc7ff9373669f7dc47b /src/battle_pyramid.c
parenta839463c849679974c986bf9c9c260eff0e94cb7 (diff)
parent9f5bf65fb336cf7a3ba68d32267bf993f0f6a494 (diff)
Merge branch 'master' of https://github.com/pret/pokeemerald into remove-temps
Diffstat (limited to 'src/battle_pyramid.c')
-rw-r--r--src/battle_pyramid.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c
index ac6d95338..50efeecb4 100644
--- a/src/battle_pyramid.c
+++ b/src/battle_pyramid.c
@@ -933,7 +933,7 @@ static void SavePyramidChallenge(void)
gSaveBlock2Ptr->frontier.challengeStatus = gSpecialVar_0x8005;
VarSet(VAR_TEMP_0, 0);
gSaveBlock2Ptr->frontier.challengePaused = TRUE;
- save_serialize_map();
+ SaveMapView();
TrySavingData(SAVE_LINK);
}
@@ -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++)