From 69d4e8133cdda57ea3158fc5c050027fa3debc50 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 7 Sep 2024 13:56:24 -0400 Subject: [PATCH] Address review comments, 2 --- include/battle_regulation.h | 4 ++-- src/battle_regulation.c | 10 +++++----- src/party_menu.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/battle_regulation.h b/include/battle_regulation.h index 44575ae02..dfd6cc325 100644 --- a/include/battle_regulation.h +++ b/include/battle_regulation.h @@ -10,7 +10,7 @@ typedef enum BattleRegulationComplianceMessage { BTL_REG_COMPLIANCE_FAIL_SPECIES_DUPE, BTL_REG_COMPLIANCE_FAIL_ITEMS_DUPE, BTL_REG_COMPLIANCE_FAIL_NUM_MONS, - BTL_REG_COMPLIANCE_FAIL_5, + BTL_REG_COMPLIANCE_FAIL_SPECIAL_CONSTRAINTS, BTL_REG_COMPLIANCE_FAIL_TOO_MANY_LEGENDS, BTL_REG_COMPLIANCE_FAIL_7, BTL_REG_COMPLIANCE_FAIL_SOUL_DEW, @@ -20,7 +20,7 @@ typedef struct LinkBattleRuleset LinkBattleRuleset; PokedexData *PokedexData_CreateAndLoad(HeapID heapId); void PokedexData_UnloadAndDelete(PokedexData *pokedex); -BOOL sub_0207496C(LinkBattleRuleset *ruleset, Pokemon *pokemon, PokedexData *pokedex); +BOOL LinkBattleRuleset_CheckDexBasedRules(LinkBattleRuleset *ruleset, Pokemon *pokemon, PokedexData *pokedex); BattleRegulationComplianceMessage LinkBattleRuleset_GetPartySelectionComplianceMessage(LinkBattleRuleset *ruleset, Party *party, PokedexData *pokedex, u8 *a3); int sub_02074CD0(LinkBattleRuleset *ruleset, Party *party, PokedexData *pokedex); diff --git a/src/battle_regulation.c b/src/battle_regulation.c index 2b78d6aea..f4ce572df 100644 --- a/src/battle_regulation.c +++ b/src/battle_regulation.c @@ -22,7 +22,7 @@ void PokedexData_UnloadAndDelete(PokedexData *pokedex) { PokedexData_Delete(pokedex); } -BOOL sub_0207496C(LinkBattleRuleset *ruleset, Pokemon *pokemon, PokedexData *pokedex) { +BOOL LinkBattleRuleset_CheckDexBasedRules(LinkBattleRuleset *ruleset, Pokemon *pokemon, PokedexData *pokedex) { u16 species = GetMonData(pokemon, MON_DATA_SPECIES, NULL); if (ruleset == NULL) { return TRUE; @@ -97,7 +97,7 @@ BattleRegulationComplianceMessage LinkBattleRuleset_GetPartySelectionComplianceM u16 heldItems[PARTY_SIZE]; if (ruleset == NULL) { - return FALSE; + return BTL_REG_COMPLIANCE_OK; } for (i = 0; i < PARTY_SIZE; ++i) { @@ -115,8 +115,8 @@ BattleRegulationComplianceMessage LinkBattleRuleset_GetPartySelectionComplianceM for (i = 0; i < PARTY_SIZE; ++i) { if (selectedOrder[i] != 0) { mon = Party_GetMonByIndex(party, selectedOrder[i] - 1); - if (!sub_0207496C(ruleset, mon, pokedex)) { - return 5; + if (!LinkBattleRuleset_CheckDexBasedRules(ruleset, mon, pokedex)) { + return BTL_REG_COMPLIANCE_FAIL_SPECIAL_CONSTRAINTS; } species[i] = GetMonData(mon, MON_DATA_SPECIES, NULL); heldItems[i] = GetMonData(mon, MON_DATA_HELD_ITEM, NULL); @@ -219,7 +219,7 @@ int sub_02074CD0(LinkBattleRuleset *ruleset, Party *party, PokedexData *pokedex) mon = Party_GetMonByIndex(party, i); species[i] = GetMonData(mon, MON_DATA_SPECIES, NULL); levels[i] = GetMonData(mon, MON_DATA_LEVEL, NULL); - if (!sub_0207496C(ruleset, mon, pokedex)) { + if (!LinkBattleRuleset_CheckDexBasedRules(ruleset, mon, pokedex)) { species[i] = SPECIES_NONE; --numLegalMons; } diff --git a/src/party_menu.c b/src/party_menu.c index 8db132b71..3fcdd7886 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -1772,7 +1772,7 @@ u8 sub_0207B364(PartyMenu *partyMenu, u8 selection) { if (partyMenu->args->linkBattleRuleset != NULL) { Pokemon *pokemon = Party_GetMonByIndex(partyMenu->args->party, selection); - if (sub_0207496C(partyMenu->args->linkBattleRuleset, pokemon, partyMenu->pokedex) == FALSE) { + if (LinkBattleRuleset_CheckDexBasedRules(partyMenu->args->linkBattleRuleset, pokemon, partyMenu->pokedex) == FALSE) { return 0; } } @@ -2013,7 +2013,7 @@ static int PartyMenu_SelectedBattleTeamComplianceCheck(PartyMenu *partyMenu) { return PARTY_MENU_STATE_WAIT_TEXT_PRINTER; case BTL_REG_COMPLIANCE_FAIL_NUM_MONS: break; - case BTL_REG_COMPLIANCE_FAIL_5: + case BTL_REG_COMPLIANCE_FAIL_SPECIAL_CONSTRAINTS: break; case BTL_REG_COMPLIANCE_FAIL_TOO_MANY_LEGENDS: PartyMenu_PrintMessageOnWindow34(partyMenu, msg_0300_00168, TRUE);