diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/battle_main.c | 12 | ||||
-rwxr-xr-x | src/party_menu.c | 18 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/battle_main.c b/src/battle_main.c index 7ae8d5c46..8a4479119 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -167,7 +167,7 @@ EWRAM_DATA static u32 sUnusedUnknownArray[25] = {0}; EWRAM_DATA u32 gBattleTypeFlags = 0; EWRAM_DATA u8 gBattleTerrain = 0; EWRAM_DATA u32 gUnknown_02022FF4 = 0; -EWRAM_DATA struct UnknownPokemonStruct4 gMultiPartnerParty[PARTY_SIZE / 2] = {0}; +EWRAM_DATA struct UnknownPokemonStruct4 gMultiPartnerParty[MULTI_PARTY_SIZE] = {0}; EWRAM_DATA static struct UnknownPokemonStruct4* sMultiPartnerPartyBuffer = NULL; EWRAM_DATA u8 *gUnknown_0202305C = NULL; EWRAM_DATA u8 *gUnknown_02023060 = NULL; @@ -1249,12 +1249,12 @@ static void CB2_HandleStartMultiPartnerBattle(void) if (gLinkPlayers[playerMultiplayerId].id != 0) { memcpy(gPlayerParty, gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2); - memcpy(gPlayerParty + PARTY_SIZE / 2, gBlockRecvBuffer[playerMultiplayerId], sizeof(struct Pokemon) * 2); + memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[playerMultiplayerId], sizeof(struct Pokemon) * 2); } else { memcpy(gPlayerParty, gBlockRecvBuffer[playerMultiplayerId], sizeof(struct Pokemon) * 2); - memcpy(gPlayerParty + PARTY_SIZE / 2, gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2); + memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2); } gBattleCommunication[MULTIUSE_STATE]++; } @@ -1667,7 +1667,7 @@ static void CB2_HandleStartMultiBattle(void) break; case 1: case 2: - memcpy(gPlayerParty + PARTY_SIZE / 2, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2); + memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2); break; } } @@ -1684,7 +1684,7 @@ static void CB2_HandleStartMultiBattle(void) break; case 1: case 2: - memcpy(gPlayerParty + PARTY_SIZE / 2, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2); + memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2); break; } } @@ -1698,7 +1698,7 @@ static void CB2_HandleStartMultiBattle(void) break; case 1: case 2: - memcpy(gEnemyParty + PARTY_SIZE / 2, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2); + memcpy(gEnemyParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2); break; } } diff --git a/src/party_menu.c b/src/party_menu.c index 55243c1cf..c711881b0 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -155,7 +155,7 @@ static EWRAM_DATA u16 *sSlot2TilemapBuffer = 0; // EWRAM_DATA u8 gSelectedOrderFromParty[4] = {0}; static EWRAM_DATA u16 sPartyMenuItemId = 0; static EWRAM_DATA u16 sUnused_0203CEFE = 0; -EWRAM_DATA u8 gBattlePartyCurrentOrder[3] = {0}; // bits 0-3 are the current pos of Slot 1, 4-7 are Slot 2, and so on +EWRAM_DATA u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2] = {0}; // bits 0-3 are the current pos of Slot 1, 4-7 are Slot 2, and so on // IWRAM common void (*gItemUseCB)(u8, TaskFunc); @@ -750,10 +750,10 @@ static void InitPartyMenuBoxes(u8 layout) static void RenderPartyMenuBox(u8 slot) { - if (gPartyMenu.menuType == PARTY_MENU_TYPE_MULTI_SHOWCASE && slot > 2) + if (gPartyMenu.menuType == PARTY_MENU_TYPE_MULTI_SHOWCASE && slot >= MULTI_PARTY_SIZE) { DisplayPartyPokemonDataForMultiBattle(slot); - if (gMultiPartnerParty[slot - 3].species == SPECIES_NONE) + if (gMultiPartnerParty[slot - MULTI_PARTY_SIZE].species == SPECIES_NONE) LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_NO_MON); else LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_MULTI_ALT); @@ -986,10 +986,10 @@ static void CreatePartyMonSprites(u8 slot) { u8 actualSlot; - if (gPartyMenu.menuType == PARTY_MENU_TYPE_MULTI_SHOWCASE && slot > 2) + if (gPartyMenu.menuType == PARTY_MENU_TYPE_MULTI_SHOWCASE && slot >= MULTI_PARTY_SIZE) { u8 status; - actualSlot = slot - 3; + actualSlot = slot - MULTI_PARTY_SIZE; if (gMultiPartnerParty[actualSlot].species != SPECIES_NONE) { @@ -1117,7 +1117,7 @@ static bool8 PartyBoxPal_ParnterOrDisqualifiedInArena(u8 slot) if (gPartyMenu.layout == PARTY_LAYOUT_MULTI && (slot == 1 || slot == 4 || slot == 5)) return TRUE; - if (slot < 3 && (gBattleTypeFlags & BATTLE_TYPE_ARENA) && gMain.inBattle && (gBattleStruct->arenaLostPlayerMons >> GetPartyIdFromBattleSlot(slot) & 1)) + if (slot < MULTI_PARTY_SIZE && (gBattleTypeFlags & BATTLE_TYPE_ARENA) && gMain.inBattle && (gBattleStruct->arenaLostPlayerMons >> GetPartyIdFromBattleSlot(slot) & 1)) return TRUE; return FALSE; @@ -6076,7 +6076,7 @@ static void Task_MultiPartnerPartySlideIn(u8 taskId) { for (i = 3; i < PARTY_SIZE; i++) { - if (gMultiPartnerParty[i - 3].species != SPECIES_NONE) + if (gMultiPartnerParty[i - MULTI_PARTY_SIZE].species != SPECIES_NONE) AnimateSelectedPartyIcon(sPartyMenuBoxes[i].monSpriteId, 0); } PlaySE(SE_W231); // The Harden SE plays once the partners party mons have slid on screen @@ -6107,7 +6107,7 @@ static void SlideMultiPartyMenuBoxSpritesOneStep(u8 taskId) for (i = 3; i < PARTY_SIZE; i++) { - if (gMultiPartnerParty[i - 3].species != SPECIES_NONE) + if (gMultiPartnerParty[i - MULTI_PARTY_SIZE].species != SPECIES_NONE) { MoveMultiPartyMenuBoxSprite(sPartyMenuBoxes[i].monSpriteId, tXPos - 8); MoveMultiPartyMenuBoxSprite(sPartyMenuBoxes[i].itemSpriteId, tXPos - 8); @@ -6236,7 +6236,7 @@ void DoBattlePyramidMonsHaveHeldItem(void) u8 i; gSpecialVar_Result = FALSE; - for (i = 0; i < 3; i++) + for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { if (GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) != ITEM_NONE) { |