Cleanup identical if blocks (#6988)

This commit is contained in:
malad1211 2025-05-27 15:12:12 +07:00 committed by GitHub
parent b49a3bbde5
commit d27a3575f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 44 deletions

View File

@ -11228,11 +11228,7 @@ static void Cmd_various(void)
else
gSideTimers[GetBattlerSide(battler)].auroraVeilTimer = gBattleTurnCounter + 5;
gSideTimers[GetBattlerSide(battler)].auroraVeilBattlerId = battler;
if (IsDoubleBattle() && CountAliveMonsInBattle(BATTLE_ALIVE_SIDE, gBattlerAttacker) == 2)
gBattleCommunication[MULTISTRING_CHOOSER] = 5;
else
gBattleCommunication[MULTISTRING_CHOOSER] = 5;
gBattleCommunication[MULTISTRING_CHOOSER] = 5;
}
break;
}

View File

@ -665,16 +665,8 @@ int EReaderHandleTransfer(u8 mode, size_t size, const void *data, void *recvBuff
if (sSendRecvMgr.xferState != EREADER_XFER_CHK)
{
if (sSendRecvMgr.isParent && sCounter1 > 2)
{
EnableSio();
sSendRecvMgr.xferState = EREADER_XFER_CHK;
}
else
{
EnableSio();
sSendRecvMgr.xferState = EREADER_XFER_CHK;
}
EnableSio();
sSendRecvMgr.xferState = EREADER_XFER_CHK;
}
}
break;

View File

@ -4678,45 +4678,27 @@ static void LoadTilesetTilemapHGSS(u8 page)
switch (page)
{
case INFO_SCREEN:
if (!HGSS_DECAPPED)
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_1_Gfx, 0x2000, 0, 0);
else
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_1_Gfx, 0x2000, 0, 0);
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_1_Gfx, 0x2000, 0, 0);
CopyToBgTilemapBuffer(3, sPokedexPlusHGSS_ScreenInfo_Tilemap, 0, 0);
break;
case STATS_SCREEN:
if (!HGSS_DECAPPED)
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_1_Gfx, 0x2000, 0, 0);
else
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_1_Gfx, 0x2000, 0, 0);
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_1_Gfx, 0x2000, 0, 0);
CopyToBgTilemapBuffer(3, sPokedexPlusHGSS_ScreenStats_Tilemap, 0, 0);
break;
case EVO_SCREEN:
if (!HGSS_DECAPPED)
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_2_Gfx, 0x2000, 0, 0);
else
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_2_Gfx, 0x2000, 0, 0);
CopyToBgTilemapBuffer(3, sPokedexPlusHGSS_ScreenEvolution_Tilemap_PE, 0, 0);
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_2_Gfx, 0x2000, 0, 0);
CopyToBgTilemapBuffer(3, sPokedexPlusHGSS_ScreenEvolution_Tilemap_PE, 0, 0);
break;
case FORMS_SCREEN:
if (!HGSS_DECAPPED)
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_2_Gfx, 0x2000, 0, 0);
else
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_2_Gfx, 0x2000, 0, 0);
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_2_Gfx, 0x2000, 0, 0);
CopyToBgTilemapBuffer(3, sPokedexPlusHGSS_ScreenForms_Tilemap, 0, 0);
break;
case CRY_SCREEN:
if (!HGSS_DECAPPED)
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_3_Gfx, 0x2000, 0, 0);
else
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_3_Gfx, 0x2000, 0, 0);
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_3_Gfx, 0x2000, 0, 0);
CopyToBgTilemapBuffer(3, sPokedexPlusHGSS_ScreenCry_Tilemap, 0, 0);
break;
case SIZE_SCREEN:
if (!HGSS_DECAPPED)
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_3_Gfx, 0x2000, 0, 0);
else
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_3_Gfx, 0x2000, 0, 0);
DecompressAndLoadBgGfxUsingHeap(3, sPokedexPlusHGSS_Menu_3_Gfx, 0x2000, 0, 0);
CopyToBgTilemapBuffer(3, sPokedexPlusHGSS_ScreenSize_Tilemap, 0, 0);
break;
}

View File

@ -2541,10 +2541,7 @@ bool8 ScrCmd_setberrytree(struct ScriptContext *ctx)
Script_RequestEffects(SCREFF_V1 | SCREFF_SAVE);
if (berry == 0)
PlantBerryTree(treeId, berry, growthStage, FALSE);
else
PlantBerryTree(treeId, berry, growthStage, FALSE);
PlantBerryTree(treeId, berry, growthStage, FALSE);
return FALSE;
}