diff --git a/include/code_80A26CC.h b/include/code_80A26CC.h index c042837e9..48293736b 100644 --- a/include/code_80A26CC.h +++ b/include/code_80A26CC.h @@ -18,7 +18,6 @@ typedef struct DungeonInfo } DungeonInfo; const DungeonInfo *GetDungeonInfo_80A2608(s32 index); -const DungeonInfo *sub_80A2620(s16 index); s16 sub_80A2654(s16 index); s16 sub_80A2668(s16); s16 sub_80A2688(u8); @@ -28,7 +27,7 @@ u8 RescueDungeonToDungeonId(s16 index); u8 sub_80A2728(s16 index); u8 ScriptDungeonIdToDungeonId(s16 index); s16 sub_80A2750(s16); -bool8 IsRescueDungeonUnlocked(s16 _rescueDungeonId); +bool8 IsRescueDungeonAvailable(s16 _rescueDungeonId); bool8 sub_80A2824(u8 index); bool8 sub_80A28F0(u8 index); s32 sub_80A29B0(u8 *); diff --git a/include/dungeon_list_menu.h b/include/dungeon_list_menu.h index 413a1d6a4..a0fed805a 100644 --- a/include/dungeon_list_menu.h +++ b/include/dungeon_list_menu.h @@ -8,6 +8,6 @@ bool8 DungeonListMenu_MoveMenuTo(s32 _rescueDungeonId); u32 DungeonListMenu_GetInput(u8 arrowType); s16 DungeonListMenu_GetCurrentRescueDungeonId(void); void DungeonListMenu_Free(void); -bool8 HasZeroUnlockedDungeons(void); +bool8 HasZeroAvailableDungeons(void); #endif diff --git a/src/code_80A26CC.c b/src/code_80A26CC.c index 205acfa8c..828261598 100644 --- a/src/code_80A26CC.c +++ b/src/code_80A26CC.c @@ -1153,9 +1153,9 @@ const DungeonInfo *GetDungeonInfo_80A2608(s32 _index) return &gUnknown_81168A8[index]; } -const DungeonInfo *sub_80A2620(s16 index) +static const DungeonInfo *GetRescueDungeonInfo(s16 rescueDungeonId) { - return &gUnknown_81168A8[RescueDungeonToScriptDungeonId(index)]; + return &gUnknown_81168A8[RescueDungeonToScriptDungeonId(rescueDungeonId)]; } UNUSED static s16 sub_80A2644(u32 index) @@ -1276,13 +1276,13 @@ s16 sub_80A2750(s16 r0) return 2; } -bool8 IsRescueDungeonUnlocked(s16 _rescueDungeonId) +bool8 IsRescueDungeonAvailable(s16 _rescueDungeonId) { // Same dumbness as above to get a match s32 _rescueDungeonIdMatch = _rescueDungeonId; s32 rescueDungeonId = _rescueDungeonIdMatch; - if (sub_80A2620(_rescueDungeonId)->unk0 == -1) + if (GetRescueDungeonInfo(_rescueDungeonId)->unk0 == -1) return FALSE; if (sub_80023E4(5)) return FALSE; @@ -1305,7 +1305,7 @@ bool8 sub_80A2824(u8 index) if (sub_80023E4(1)) { for (i = 0; i < RESCUE_DUNGEON_COUNT; i++) { - temp = sub_80A2620(i); + temp = GetRescueDungeonInfo(i); if (temp->unk11 != 0) { if (temp->dungeonIndex == index) { @@ -1319,7 +1319,7 @@ bool8 sub_80A2824(u8 index) } else { for (i = 0; i < RESCUE_DUNGEON_COUNT; i++) { - temp = sub_80A2620(i); + temp = GetRescueDungeonInfo(i); if (temp->unk11 != 0) if (temp->dungeonIndex == index) @@ -1335,7 +1335,7 @@ UNUSED static bool8 sub_80A28B4(s16 r0) { const DungeonInfo *temp; - temp = sub_80A2620(r0); + temp = GetRescueDungeonInfo(r0); if (temp->unk0 != -1) { if (!sub_8097384(r0) && !RescueScenarioConquered(r0)) @@ -1353,7 +1353,7 @@ bool8 sub_80A28F0(u8 index) const DungeonInfo *temp; for (counter = 0; counter < 0x2E; counter++) { - temp = sub_80A2620(counter); + temp = GetRescueDungeonInfo(counter); if (temp->unk11 != 0) { if (temp->dungeonIndex == index) { @@ -1388,7 +1388,7 @@ UNUSED static s32 sub_80A293C(u8 *param_1) for (index = 0; index < RESCUE_DUNGEON_COUNT; index++) { - iVar3 = sub_80A2620(index); + iVar3 = GetRescueDungeonInfo(index); if (iVar3->unk11 != 0 && sub_8097384((s16) index)) local_68[iVar3->dungeonIndex] = 1; } @@ -1432,7 +1432,7 @@ s32 sub_80A29B0(u8 *param_1) if (sub_80023E4(1)) { for (index = 0; index < RESCUE_DUNGEON_COUNT; index++) { - iVar3 = sub_80A2620(index); + iVar3 = GetRescueDungeonInfo(index); if (iVar3->unk11 != 0 && RescueScenarioConquered((s16) index)) local_68[iVar3->dungeonIndex] = 1; @@ -1474,7 +1474,7 @@ UNUSED static s32 sub_80A2A5C(u8 *param_1) if (sub_80023E4(1)) { for (index = 0; index < RESCUE_DUNGEON_COUNT; index++) { - iVar3 = sub_80A2620(index); + iVar3 = GetRescueDungeonInfo(index); if (iVar3->unk11 != 0 && (sub_8097384((s16) index) || RescueScenarioConquered((s16) index))) local_58[iVar3->dungeonIndex] = 1; @@ -1482,7 +1482,7 @@ UNUSED static s32 sub_80A2A5C(u8 *param_1) } else { for (index = 0; index < RESCUE_DUNGEON_COUNT; index++) { - iVar3 = sub_80A2620(index); + iVar3 = GetRescueDungeonInfo(index); if (iVar3->unk11 != 0 && sub_8097384((s16) index)) local_58[iVar3->dungeonIndex] = 1; diff --git a/src/dungeon_list_menu.c b/src/dungeon_list_menu.c index 979b3fc51..ba61ffc82 100644 --- a/src/dungeon_list_menu.c +++ b/src/dungeon_list_menu.c @@ -56,7 +56,7 @@ static s32 CountAvailableDungeons(void); bool8 DungeonListMenu_Init(u32 windowId, DungeonPos *winPos, s32 perPageCount, bool8 showIcons) { - if (HasZeroUnlockedDungeons()) + if (HasZeroAvailableDungeons()) return FALSE; if (sDungeonListMenu == NULL) @@ -205,8 +205,8 @@ static s32 CountAvailableDungeons(void) counter = 0; for (i = 0; i < RESCUE_DUNGEON_COUNT; i++) { - rescueDungeonId = rescueDungeonId = (s16)i; // NOTE: weirdness needing for matching s16 memes - if (IsRescueDungeonUnlocked(i) && rescueDungeonId != RESCUE_DUNGEON_GREAT_CANYON_2 && rescueDungeonId != RESCUE_DUNGEON_MT_FREEZE_2) { + rescueDungeonId = rescueDungeonId = (s16)i; // NOTE: weirdness needed for matching s16 memes + if (IsRescueDungeonAvailable(i) && rescueDungeonId != RESCUE_DUNGEON_GREAT_CANYON_2 && rescueDungeonId != RESCUE_DUNGEON_MT_FREEZE_2) { sDungeonListMenu->rescueDungeonIds[counter] = rescueDungeonId; sDungeonListMenu->goIcon[counter] = icons; sDungeonListMenu->jobInDungeon[counter] = icons; @@ -234,7 +234,7 @@ static s32 CountAvailableDungeons(void) } sDungeonListMenu->goIcon[counter] = goIcon; if (!goIcon && CountJobsinDungeon(dungeonIndex) > 0) { - sDungeonListMenu->jobInDungeon[counter] = 1; + sDungeonListMenu->jobInDungeon[counter] = TRUE; } } counter++; @@ -244,11 +244,11 @@ static s32 CountAvailableDungeons(void) return counter; } -bool8 HasZeroUnlockedDungeons(void) +bool8 HasZeroAvailableDungeons(void) { s32 i; for (i = 0; i < RESCUE_DUNGEON_COUNT; i++) { - if (IsRescueDungeonUnlocked(i)) + if (IsRescueDungeonAvailable(i)) return FALSE; } diff --git a/src/friend_area_action_menu.c b/src/friend_area_action_menu.c index 560418b15..606f0db88 100644 --- a/src/friend_area_action_menu.c +++ b/src/friend_area_action_menu.c @@ -24,6 +24,7 @@ #include "text_1.h" #include "text_2.h" #include "unk_ds_only_feature.h" +#include "music_util.h" static EWRAM_INIT struct unkStruct_203B2BC *sUnknown_203B2BC = {NULL}; @@ -48,8 +49,6 @@ extern void CreateFriendActionMenu(); extern void sub_80276A8(); bool8 sub_8027D9C(Pokemon *pokeStruct); extern u8 sub_8027DCC(Pokemon *); -extern void SetFriendAreaActionMenuState(u32); -extern void PlaySound(u32); u32 sub_8027E18(Pokemon *); u8 sub_8027E4C(Pokemon *r0); diff --git a/src/ground_script.c b/src/ground_script.c index fafacb850..096cb8a6a 100644 --- a/src/ground_script.c +++ b/src/ground_script.c @@ -1347,7 +1347,7 @@ static s32 ExecuteScriptCommand(Action *action) } case 0x04: { if (curCmd.arg1 == -1) { - if (!HasZeroUnlockedDungeons() && sub_809B1C0(12,0,NULL)) { + if (!HasZeroAvailableDungeons() && sub_809B1C0(12,0,NULL)) { sub_80A87AC(0, 11); action->scriptData.branchDiscriminant = 0; } else { diff --git a/src/textbox.c b/src/textbox.c index 8335f99d6..07cee1211 100644 --- a/src/textbox.c +++ b/src/textbox.c @@ -872,7 +872,7 @@ bool8 sub_809B1D4(s32 a0, u32 kind, s32 a2, void *a3) break; case 0xC: sub_8001D88(); - if (HasZeroUnlockedDungeons()) { + if (HasZeroAvailableDungeons()) { return FALSE; } break;