From 82c65d37e737dae3e1c7314253ece14664c4f562 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Thu, 31 Aug 2023 03:00:59 -0400 Subject: [PATCH] Fixed 2v1 handling when debug menu is enabled (#3223) --- src/battle_main.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index d26fc325f..ecbd0ba83 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -565,13 +565,12 @@ static void CB2_InitBattleInternal(void) gBattle_BG3_X = 0; gBattle_BG3_Y = 0; -#if DEBUG_OVERWORLD_MENU == FALSE - - gBattleTerrain = BattleSetup_GetTerrainId(); -#else +#if DEBUG_OVERWORLD_MENU == TRUE if (!gIsDebugBattle) - gBattleTerrain = BattleSetup_GetTerrainId(); #endif + { + gBattleTerrain = BattleSetup_GetTerrainId(); + } if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) gBattleTerrain = BATTLE_TERRAIN_BUILDING; @@ -594,27 +593,19 @@ static void CB2_InitBattleInternal(void) else SetMainCallback2(CB2_HandleStartBattle); -#if DEBUG_OVERWORLD_MENU == FALSE - if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED))) - { - CreateNPCTrainerParty(&gEnemyParty[0], gTrainerBattleOpponent_A, TRUE); - if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS && !BATTLE_TWO_VS_ONE_OPPONENT) - CreateNPCTrainerParty(&gEnemyParty[PARTY_SIZE / 2], gTrainerBattleOpponent_B, FALSE); - SetWildMonHeldItem(); - CalculateEnemyPartyCount(); - } -#else +#if DEBUG_OVERWORLD_MENU == TRUE if (!gIsDebugBattle) +#endif { if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED))) { CreateNPCTrainerParty(&gEnemyParty[0], gTrainerBattleOpponent_A, TRUE); - if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS && !BATTLE_TWO_VS_ONE_OPPONENT) CreateNPCTrainerParty(&gEnemyParty[PARTY_SIZE / 2], gTrainerBattleOpponent_B, FALSE); SetWildMonHeldItem(); + CalculateEnemyPartyCount(); } } -#endif gMain.inBattle = TRUE; gSaveBlock2Ptr->frontier.disableRecordBattle = FALSE;