diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index a9629f6622..0f1ce1b17f 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -386,13 +386,9 @@ static void CompleteOnHealthbarDone(void) SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); if (hpValue != -1) - { UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT); - } else - { LinkOpponentBufferExecCompleted(); - } } static void HideHealthboxAfterMonFaint(void) diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 4c274f17e3..b3554dc5af 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -397,9 +397,7 @@ static void CompleteOnHealthbarDone(void) s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0); SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); if (hpValue != -1) - { UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT); - } else OpponentBufferExecCompleted(); } diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 0fb14f20d5..872a61c0e7 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -373,13 +373,9 @@ static void CompleteOnHealthbarDone(void) SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]); if (hpValue != -1) - { UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT); - } else - { RecordedOpponentBufferExecCompleted(); - } } static void HideHealthboxAfterMonFaint(void) diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 20681b27ce..e5cfb3be68 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -660,18 +660,12 @@ static void PrepareBufferDataTransfer(u8 bufferId, u8 *data, u16 size) switch (bufferId) { case BUFFER_A: - for (i = 0; i < size; i++) - { + for (i = 0; i < size; data++, i++) gBattleBufferA[gActiveBattler][i] = *data; - data++; - } break; case BUFFER_B: - for (i = 0; i < size; i++) - { + for (i = 0; i < size; data++, i++) gBattleBufferB[gActiveBattler][i] = *data; - data++; - } break; } } @@ -808,8 +802,7 @@ static void Task_HandleSendLinkBuffersData(u8 taskId) } break; case 5: - gTasks[taskId].data[13]--; - if (gTasks[taskId].data[13] == 0) + if (--gTasks[taskId].data[13] == 0) { gTasks[taskId].data[13] = 1; gTasks[taskId].data[11] = 3; @@ -824,7 +817,7 @@ void TryReceiveLinkBattleData(void) s32 j; u8 *recvBuffer; - if (gReceivedRemoteLinkPlayers != 0 && (gBattleTypeFlags & BATTLE_TYPE_LINK_IN_BATTLE)) + if (gReceivedRemoteLinkPlayers && (gBattleTypeFlags & BATTLE_TYPE_LINK_IN_BATTLE)) { DestroyTask_RfuIdle(); for (i = 0; i < GetLinkPlayerCount(); i++) diff --git a/src/battle_main.c b/src/battle_main.c index ad4ea88b9e..52a1005989 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -967,7 +967,7 @@ static void CB2_HandleStartBattle(void) case 1: if (gBattleTypeFlags & BATTLE_TYPE_LINK) { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { if (IsLinkTaskFinished()) { @@ -1175,7 +1175,7 @@ static void CB2_HandleStartMultiPartnerBattle(void) case 1: if (gBattleTypeFlags & BATTLE_TYPE_LINK) { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { u8 language; @@ -1442,7 +1442,7 @@ static void CB2_PreInitMultiBattle(void) switch (gBattleCommunication[MULTIUSE_STATE]) { case 0: - if (gReceivedRemoteLinkPlayers != 0 && IsLinkTaskFinished()) + if (gReceivedRemoteLinkPlayers && IsLinkTaskFinished()) { sMultiPartnerPartyBuffer = Alloc(sizeof(gMultiPartnerParty)); SetMultiPartnerMenuParty(0); @@ -1578,7 +1578,7 @@ static void CB2_HandleStartMultiBattle(void) case 1: if (gBattleTypeFlags & BATTLE_TYPE_LINK) { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { if (IsLinkTaskFinished()) { @@ -5183,7 +5183,7 @@ static void ReturnFromBattleToOverworld(void) PartySpreadPokerus(gPlayerParty); } - if (gBattleTypeFlags & BATTLE_TYPE_LINK && gReceivedRemoteLinkPlayers != 0) + if (gBattleTypeFlags & BATTLE_TYPE_LINK && gReceivedRemoteLinkPlayers) return; gSpecialVar_Result = gBattleOutcome; diff --git a/src/battle_tower.c b/src/battle_tower.c index bebbdee7da..62feb7f838 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -2635,7 +2635,7 @@ static void LoadLinkMultiOpponentsData(void) gTrainerBattleOpponent_B = gSaveBlock2Ptr->frontier.trainerIds[battleNum * 2 + 1]; SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0); SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1); - if (gReceivedRemoteLinkPlayers != 0 && gWirelessCommType == 0) + if (gReceivedRemoteLinkPlayers && gWirelessCommType == 0) gSpecialVar_Result = 4; else gSpecialVar_Result = 6; diff --git a/src/berry_crush.c b/src/berry_crush.c index 19c03391d3..d93dbe80ad 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -3428,7 +3428,7 @@ static u32 Cmd_CloseLink(struct BerryCrushGame *game, u8 *args) SetCloseLinkCallback(); break; case 2: - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) return 0; game->nextCmd = CMD_QUIT; RunOrScheduleCommand(CMD_HIDE_GAME, SCHEDULE_CMD, NULL); diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 11bf12925b..a3710e04fb 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -665,7 +665,7 @@ void StartDodrioBerryPicking(u16 partyId, void (*exitCallback)(void)) { sExitingGame = FALSE; - if (gReceivedRemoteLinkPlayers != 0 && (sGame = AllocZeroed(sizeof(*sGame)))) + if (gReceivedRemoteLinkPlayers && (sGame = AllocZeroed(sizeof(*sGame)))) { ResetTasksAndSprites(); InitDodrioGame(sGame); @@ -775,7 +775,7 @@ static void Task_StartDodrioGame(u8 taskId) case 3: if (IsLinkTaskFinished()) { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { LoadWirelessStatusIndicatorSpriteGfx(); CreateWirelessStatusIndicatorSprite(0, 0); diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c index c54d6c3d34..437cec2fdb 100644 --- a/src/link_rfu_2.c +++ b/src/link_rfu_2.c @@ -1115,7 +1115,7 @@ static void RfuHandleReceiveCommand(u8 unused) { gRfu.recvBlock[i].receiving = RECV_STATE_FINISHED; Rfu_SetBlockReceivedFlag(i); - if (GetHostRfuGameData()->activity == (ACTIVITY_CHAT | IN_UNION_ROOM) && gReceivedRemoteLinkPlayers != 0 && gRfu.parentChild == MODE_CHILD) + if (GetHostRfuGameData()->activity == (ACTIVITY_CHAT | IN_UNION_ROOM) && gReceivedRemoteLinkPlayers && gRfu.parentChild == MODE_CHILD) ValidateAndReceivePokemonSioInfo(gBlockRecvBuffer); } } diff --git a/src/minigame_countdown.c b/src/minigame_countdown.c index 5aaed0cb23..b4d3b6558b 100644 --- a/src/minigame_countdown.c +++ b/src/minigame_countdown.c @@ -315,7 +315,7 @@ static void Task_StaticCountdown_Run(u8 taskId) u16 packet[RFU_PACKET_SIZE]; s16 *data = gTasks[taskId].data; - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { // Read link timer if (gRecvCmds[0][1] == LINKCMD_COUNTDOWN) diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index c35fe8ed80..b6610a6403 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -201,7 +201,7 @@ static void CB2_MysteryEventMenu(void) case 6: if (IsLinkConnectionEstablished()) { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { if (GetLinkPlayerDataExchangeStatusTimed(2, 2) == EXCHANGE_DIFF_SELECTIONS) { diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c index b970711fd3..92e544a27b 100644 --- a/src/mystery_gift_menu.c +++ b/src/mystery_gift_menu.c @@ -1232,7 +1232,7 @@ static void Task_MysteryGift(u8 taskId) data->state = MG_STATE_CLIENT_LINK_WAIT; break; case MG_STATE_CLIENT_LINK_WAIT: - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { ClearScreenInBg0(TRUE); data->state = MG_STATE_CLIENT_COMMUNICATING; @@ -1528,7 +1528,7 @@ static void Task_MysteryGift(u8 taskId) } break; case MG_STATE_SERVER_LINK_WAIT: - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { ClearScreenInBg0(TRUE); data->state = MG_STATE_SERVER_LINK_START; diff --git a/src/record_mixing.c b/src/record_mixing.c index 3a831c8ce1..b03d7be2f3 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -444,7 +444,7 @@ static void Task_MixingRecordsRecv(u8 taskId) } break; case 1: // wait for handshake - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { ConvertIntToDecimalStringN(gStringVar1, GetMultiplayerId_(), STR_CONV_MODE_LEADING_ZEROS, 2); task->tState = 5; diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index 3a087b7d78..4217d78c73 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -149,7 +149,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void) ActionSelectionCreateCursorAt(gActionSelectionCursor[gBattlerInMenuId], 0); - if (gWirelessCommType != 0 && gReceivedRemoteLinkPlayers != 0) + if (gWirelessCommType != 0 && gReceivedRemoteLinkPlayers) { LoadWirelessStatusIndicatorSpriteGfx(); CreateWirelessStatusIndicatorSprite(0, 0); diff --git a/src/trade.c b/src/trade.c index 7c712b5803..e24051e041 100644 --- a/src/trade.c +++ b/src/trade.c @@ -2391,7 +2391,7 @@ s32 GetGameProgressForLinkTrade(void) s32 isGameFrLg; u16 version; - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { isGameFrLg = 0; version = (gLinkPlayers[GetMultiplayerId() ^ 1].version & 0xFF); diff --git a/src/union_room.c b/src/union_room.c index 67d1059ee0..7d14176717 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -702,7 +702,7 @@ static void Task_TryBecomeLinkLeader(u8 taskId) } else { - if (gReceivedRemoteLinkPlayers != 0) + if (gReceivedRemoteLinkPlayers) { if (IsActivityWithVariableGroupSize(gPlayerCurrActivity)) GetOtherPlayersInfoFlags(); @@ -2047,7 +2047,7 @@ static void Task_SendMysteryGift(u8 taskId) { data->state = 13; } - else if (gReceivedRemoteLinkPlayers != 0) + else if (gReceivedRemoteLinkPlayers) { UpdateGameData_GroupLockedIn(TRUE); data->state++;