Skip to content

Commit

Permalink
fix broken battle arena gfx (#4307)
Browse files Browse the repository at this point in the history
  • Loading branch information
DizzyEggg authored Mar 26, 2024
1 parent 68fa212 commit 6abd75b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3250,6 +3250,17 @@ static void BattleMainCB1(void)
gBattlerControllerFuncs[battler](battler);
}

static void ClearSetBScriptingStruct(void)
{
// windowsType is set up earlier in BattleInitBgsAndWindows, so we need to save the value
u32 temp = gBattleScripting.windowsType;
memset(&gBattleScripting, 0, sizeof(gBattleScripting));

gBattleScripting.windowsType = temp;
gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle;
gBattleScripting.expOnCatch = (B_EXP_CATCH >= GEN_6);
}

static void BattleStartClearSetData(void)
{
s32 i;
Expand All @@ -3263,10 +3274,7 @@ static void BattleStartClearSetData(void)
memset(&gSideTimers, 0, sizeof(gSideTimers));
memset(&gWishFutureKnock, 0, sizeof(gWishFutureKnock));
memset(&gBattleResults, 0, sizeof(gBattleResults));
memset(&gBattleScripting, 0, sizeof(gBattleScripting));

gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle;
gBattleScripting.expOnCatch = (B_EXP_CATCH >= GEN_6);
ClearSetBScriptingStruct();

for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
Expand Down

0 comments on commit 6abd75b

Please sign in to comment.