diff --git a/src/battle_main.c b/src/battle_main.c index 0c3e84c1ea..d2763b0000 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4962,11 +4962,7 @@ static void CheckFocusPunch_ClearVarsBeforeTurnStarts(void) TryClearRageStatuses(); gCurrentTurnActionNumber = 0; -{ - // something stupid needed to match - u8 zero; - gCurrentActionFuncId = gActionsByTurnOrder[(zero = 0)]; -} + gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber]; gDynamicBasePower = 0; gBattleStruct->dynamicMoveType = 0; gBattleMainFunc = RunTurnActionsFunctions; diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c index 6a2605c96e..7f3bfa20da 100644 --- a/src/link_rfu_2.c +++ b/src/link_rfu_2.c @@ -923,7 +923,7 @@ static bool32 RfuProcessEnqueuedRecvBlock(void) static void HandleSendFailure(u8 unused, u32 flags) { - s32 i, j; + s32 i, j, temp; const u8 *r10 = Rfu.sendBlock.payload; for (i = 0; i < Rfu.sendBlock.count; i++) @@ -933,14 +933,14 @@ static void HandleSendFailure(u8 unused, u32 flags) sResendBlock16[0] = RFUCMD_0x8900 | i; for (j = 0; j < 7; j++) { - sResendBlock16[j + 1] = (r10[12 * i + (j << 1) + 1] << 8) | r10[12 * i + (j << 1) + 0]; + temp = j << 1; + sResendBlock16[j + 1] = (r10[12 * i + temp + 1] << 8) | r10[12 * i + temp + 0]; } for (j = 0; j < 7; j++) { - sResendBlock8[2 * j + 1] = sResendBlock16[j] >> 8; - sResendBlock8[2 * j + 0] = sResendBlock16[j]; - - j++;j--; // Needed to match; + temp = j << 1; + sResendBlock8[temp + 1] = sResendBlock16[j] >> 8; + sResendBlock8[temp + 0] = sResendBlock16[j]; } RfuSendQueue_Enqueue(&Rfu.sendQueue, sResendBlock8); Rfu.sendBlock.failedFlags |= (1 << i);