From 642312baf11bc10c737f9c872907224c025bdeee Mon Sep 17 00:00:00 2001 From: Kermalis <29823718+Kermalis@users.noreply.github.com> Date: Thu, 18 Dec 2025 07:28:06 -0500 Subject: [PATCH] Remove some != false --- src/code_803C1B4.c | 2 +- src/code_803DA7C_2.c | 2 +- src/dungeon_main.c | 2 +- src/dungeon_menu_team.c | 2 +- src/dungeon_message.c | 2 +- src/dungeon_message_log.c | 2 +- src/dungeon_submenu.c | 2 +- src/ground_bg.c | 2 +- src/kecleon_bros1.c | 4 ++-- src/kecleon_bros2.c | 2 +- src/rescue_scenario.c | 2 +- src/textbox.c | 16 ++++++++-------- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/code_803C1B4.c b/src/code_803C1B4.c index bd95f66f6..6d76c6937 100644 --- a/src/code_803C1B4.c +++ b/src/code_803C1B4.c @@ -132,7 +132,7 @@ void sub_803C37C(DungeonLocation *location, u8 r1, u8 *itemReward) flag = GetScriptVarArrayValue(0, EVENT_B01P01, 1) ? TRUE : FALSE; if(r4 == ITEM_MIME_JR_FIG) if(GetScriptVarArrayValue(0, EVENT_B01P01, 0)) flag = TRUE; - } while(flag != FALSE); + } while(flag); *itemReward = r4; } diff --git a/src/code_803DA7C_2.c b/src/code_803DA7C_2.c index 095709e57..465c9139d 100644 --- a/src/code_803DA7C_2.c +++ b/src/code_803DA7C_2.c @@ -144,7 +144,7 @@ void sub_803E178(void) gDungeon->unk3A12 = 28; } else { - gDungeon->unk3A12 = (IsStairDirectionUp(gDungeon->unk644.dungeonLocation.id) != FALSE) ? 23 : 22; + gDungeon->unk3A12 = IsStairDirectionUp(gDungeon->unk644.dungeonLocation.id) ? 23 : 22; } } else if (val == 1) { diff --git a/src/dungeon_main.c b/src/dungeon_main.c index 087540590..bec907ecc 100644 --- a/src/dungeon_main.c +++ b/src/dungeon_main.c @@ -629,7 +629,7 @@ static void TryCreateModeArrows(Entity *leader) if (unkPtr->rotateModeDirection < NUM_DIRECTIONS) { s32 x, xMul, x2; s32 y, yMul, y2; - s32 to = (sShowThreeArrows2 != FALSE && sShowThreeArrows1 != FALSE) ? 3 : 1; + s32 to = (sShowThreeArrows2 && sShowThreeArrows1) ? 3 : 1; xMul = sRotateArrowsInfo[direction].x * 10; x2 = (sArrowsFrames / 2) & 7; diff --git a/src/dungeon_menu_team.c b/src/dungeon_menu_team.c index d2cf9d551..ba1fadca3 100644 --- a/src/dungeon_menu_team.c +++ b/src/dungeon_menu_team.c @@ -268,7 +268,7 @@ static void PrintOnDungeonTeamMenu(struct UnkFieldTeamMenuStruct *a0, WindowTemp gDungeonMenu.currPage = 0; gDungeonMenu.pagesCount = 0; gDungeonMenu.unk4 = 0; - gDungeonMenu.firstEntryY = (withHeader != FALSE) * 16; + gDungeonMenu.firstEntryY = withHeader ? 16 : 0; gDungeonMenu.leftRightArrowsPos.x = 0; gDungeonMenu.leftRightArrowsPos.y = 0; gDungeonMenu.unk14.x = 0; diff --git a/src/dungeon_message.c b/src/dungeon_message.c index 56fa02f8d..d1e7c7fee 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -339,7 +339,7 @@ void DisplayDungeonMessage_Async(struct MonDialogueSpriteInfo *monSpriteInfo, co monPortraitPtr = &monPortrait; } - CreateMenuDialogueBoxAndPortrait(str, 0, 0, NULL, NULL, 3, 0, monPortraitPtr, (a2 != FALSE) ? 0x701 : 0x400); + CreateMenuDialogueBoxAndPortrait(str, 0, 0, NULL, NULL, 3, 0, monPortraitPtr, a2 ? 0x701 : 0x400); gDungeon->unk1BDD4.unk1C05F = 1; PRINT_STRING_WAIT_PRESS_ASYNC(&chosenMenuIndex); gDungeon->unk1BDD4.unk1C05F = 0; diff --git a/src/dungeon_message_log.c b/src/dungeon_message_log.c index 91b37b6cd..18b83d519 100644 --- a/src/dungeon_message_log.c +++ b/src/dungeon_message_log.c @@ -273,7 +273,7 @@ static void CreateMessageLogArrow(bool8 upArrow, s32 y) SpriteSetObjMode(&sMessageLogArrowSpriteOAM, 0); SpriteSetMosaic(&sMessageLogArrowSpriteOAM, 0); SpriteSetBpp(&sMessageLogArrowSpriteOAM, 0); - SpriteSetMatrixNum(&sMessageLogArrowSpriteOAM, (upArrow != FALSE) ? (16) : 0); + SpriteSetMatrixNum(&sMessageLogArrowSpriteOAM, upArrow ? 16 : 0); SpriteSetPalNum(&sMessageLogArrowSpriteOAM, 15); SpriteSetY(&sMessageLogArrowSpriteOAM, (window->y * 8) + y); SpriteSetX(&sMessageLogArrowSpriteOAM, (window->x * 8) + 92); diff --git a/src/dungeon_submenu.c b/src/dungeon_submenu.c index 3c94740f5..efe38820f 100644 --- a/src/dungeon_submenu.c +++ b/src/dungeon_submenu.c @@ -61,7 +61,7 @@ void CreateDungeonMenuSubWindow(WindowTemplate *mainWindow, s32 subWindowX) s32 colorId, y; u8 text[20]; - colorId = (CanSubMenuItemBeChosen(i) != FALSE) ? 7 : 2; + colorId = CanSubMenuItemBeChosen(i) ? 7 : 2; sprintfStatic(text, _("{COLOR}%c%s"), colorId, GetDungeonSubMenuItemString(i)); y = GetMenuEntryYCoord(&gDungeonMenu, i); PrintStringOnWindow(8, y, text, 1, 0); diff --git a/src/ground_bg.c b/src/ground_bg.c index 1f505dbde..832ec040b 100644 --- a/src/ground_bg.c +++ b/src/ground_bg.c @@ -729,7 +729,7 @@ void sub_80A3BB0(GroundBg *groundBg, s32 a0_) mapRender[i].tilemapRenderFunc = RenderChunksToBgTilemap_2x2; break; case CHUNK_DIMENSIONS_3x3: - mapRender[i].tilemapRenderFunc = (mapRender[i].wrapAround != FALSE) ? RenderChunksToBgTilemapWrapAround_3x3 : RenderChunksToBgTilemap_3x3; + mapRender[i].tilemapRenderFunc = mapRender[i].wrapAround ? RenderChunksToBgTilemapWrapAround_3x3 : RenderChunksToBgTilemap_3x3; break; } break; diff --git a/src/kecleon_bros1.c b/src/kecleon_bros1.c index 4f93360c9..9a10e7230 100644 --- a/src/kecleon_bros1.c +++ b/src/kecleon_bros1.c @@ -412,7 +412,7 @@ static void UpdateKecleonStoreDialogue(void) break; case KECLEON_STORE_BUY_ITEM_RECEIPT: if (CountKecleonItems() == 0) { - if (sKecleonBrosWork1->isKecleonItemShop != FALSE) + if (sKecleonBrosWork1->isKecleonItemShop) sub_801A010(); else sub_801A3DC(); @@ -420,7 +420,7 @@ static void UpdateKecleonStoreDialogue(void) } else { if (GetNumberOfFilledInventorySlots() >= INVENTORY_SIZE) { - if (sKecleonBrosWork1->isKecleonItemShop != FALSE) + if (sKecleonBrosWork1->isKecleonItemShop) sub_801A010(); else sub_801A3DC(); diff --git a/src/kecleon_bros2.c b/src/kecleon_bros2.c index c430932ac..76d0e93f6 100644 --- a/src/kecleon_bros2.c +++ b/src/kecleon_bros2.c @@ -70,7 +70,7 @@ u32 sub_8019EDC(bool8 r0) PlayMenuSoundEffect(MENU_SFX_INFO); return 4; default: - if (MenuCursorUpdate(&gUnknown_203B214->m.input, 1) != FALSE) { + if (MenuCursorUpdate(&gUnknown_203B214->m.input, 1)) { sub_801A064(); sub_801A0D8(); return 1; diff --git a/src/rescue_scenario.c b/src/rescue_scenario.c index b45418574..8c6dc0c5a 100644 --- a/src/rescue_scenario.c +++ b/src/rescue_scenario.c @@ -131,7 +131,7 @@ bool8 RescueScenarioConquered(s32 rescueDungeonID_) if (rescueDungeonID == RESCUE_DUNGEON_DUMMY) return FALSE; - return (GetScriptVarArrayValue(NULL, RESCUE_SCENARIO_CONQUEST_LIST, (u16)rescueDungeonID) != FALSE); + return GetScriptVarArrayValue(NULL, RESCUE_SCENARIO_CONQUEST_LIST, (u16)rescueDungeonID) != FALSE; } void SetRescueScenarioConquered(s32 rescueDungeonID_, bool32 conquered) diff --git a/src/textbox.c b/src/textbox.c index db6f00bae..323375a75 100644 --- a/src/textbox.c +++ b/src/textbox.c @@ -1516,9 +1516,9 @@ static bool8 sub_809B648(void) FinishWriteSavePak(); return 0; case SPECIAL_TEXT_STORAGE_WITH_DIALOG: { - bool8 unkBool = (CheckQuest(QUEST_SQUARE_ASLEEP) != FALSE); + u32 mode = CheckQuest(QUEST_SQUARE_ASLEEP) ? 1 : 0; ResetTextbox(); - if (CreateKangaskhanStorage(unkBool)) { + if (CreateKangaskhanStorage(mode)) { sTextbox->unk418 = &gUnknown_81161C8; return 1; } @@ -1529,9 +1529,9 @@ static bool8 sub_809B648(void) sTextbox->unk418 = &gUnknown_81161D8; return 1; case SPECIAL_TEXT_BANK: { - bool8 unkBool = (CheckQuest(QUEST_SQUARE_ASLEEP) != FALSE); + u32 mode = CheckQuest(QUEST_SQUARE_ASLEEP) ? 1 : 0; ResetTextbox(); - if (CreateFelicityBank(unkBool)) { + if (CreateFelicityBank(mode)) { sTextbox->unk418 = &gUnknown_81161E8; return 1; } @@ -1565,9 +1565,9 @@ static bool8 sub_809B648(void) } } case SPECIAL_TEXT_LINK_SHOP: { - bool8 unkBool = (CheckQuest(QUEST_SQUARE_ASLEEP) != FALSE); + u32 mode = CheckQuest(QUEST_SQUARE_ASLEEP) ? 1 : 0; ResetTextbox(); - if (sub_801FB50(unkBool)) { + if (sub_801FB50(mode)) { sTextbox->unk418 = &gUnknown_8116208; return 1; } @@ -1606,9 +1606,9 @@ static bool8 sub_809B648(void) } return 0; case SPECIAL_TEXT_FRIEND_SHOP: { - bool8 unk = CheckQuest(QUEST_SQUARE_ASLEEP) != FALSE; + u32 mode = CheckQuest(QUEST_SQUARE_ASLEEP) ? 1 : 0; ResetTextbox(); - if (CreateWigglytuffShop(unk)) { + if (CreateWigglytuffShop(mode)) { sTextbox->unk418 = &gUnknown_8116218; return 1; }