Skip to content

Commit

Permalink
fix broken battle arena gfx (rh-hideout#4307)
Browse files Browse the repository at this point in the history
  • Loading branch information
DizzyEggg authored and Pawkkie committed May 16, 2024
1 parent db631a8 commit 35cbc6f
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 @@ -2970,6 +2970,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 @@ -2983,10 +2994,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 35cbc6f

Please sign in to comment.