diff --git a/src/AgbRfu_LinkManager.c b/src/AgbRfu_LinkManager.c index d696c01d3c14..b53b69c48b44 100644 --- a/src/AgbRfu_LinkManager.c +++ b/src/AgbRfu_LinkManager.c @@ -59,7 +59,9 @@ void rfu_LMAN_REQ_sendData(bool8 clockChangeFlag) clockChangeFlag = FALSE; } else + { lman.parentAck_flag = 0; + } rfu_REQ_sendData(clockChangeFlag); } diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 3a558969b55d..ee532f4134e2 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -4043,7 +4043,9 @@ static void AnimMilkBottle_Step1(struct Sprite *sprite) sprite->data[6]++; } else if (sprite->data[7] > 0) + { sprite->data[7]--; + } SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(sprite->data[6], sprite->data[7])); if (sprite->data[6] == 16 && sprite->data[7] == 0) diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 3d2e72cacbff..bf7e774f6b3d 100644 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -2209,7 +2209,9 @@ static void AnimTask_Splash_Step(u8 taskId) task->data[4] -= 2; } else + { task->data[1]++; + } break; case 3: if (!RunAffineAnimFromTaskData(task)) @@ -2956,7 +2958,9 @@ static void AnimTask_SpeedDust_Step(u8 taskId) task->data[8] = 1; } else + { task->data[8] = 2; + } } } break; diff --git a/src/battle_anim_electric.c b/src/battle_anim_electric.c index b6a82b8d9a1e..cc36e608f891 100644 --- a/src/battle_anim_electric.c +++ b/src/battle_anim_electric.c @@ -597,7 +597,9 @@ static void AnimZapCannonSpark_Step(struct Sprite *sprite) sprite->invisible ^= 1; } else + { DestroyAnimSprite(sprite); + } } static void AnimThunderboltOrb_Step(struct Sprite *sprite) @@ -870,7 +872,9 @@ static void AnimTask_ElectricChargingParticles_Step(u8 taskId) } } else if(task->data[7] == 0) + { DestroyAnimVisualTask(taskId); + } } static void AnimElectricChargingParticles_Step(struct Sprite *sprite) @@ -991,7 +995,9 @@ void AnimTask_VoltTackleAttackerReappear(u8 taskId) gSprites[task->data[15]].x2 = task->data[14]; } else + { task->data[0]++; + } } break; diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index d6afd4c304fe..6cb7da5c206d 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -280,7 +280,9 @@ static void AnimConfuseRayBallBounce_Step2(struct Sprite *sprite) sprite->callback = DestroyAnimSpriteAndDisableBlend; } else + { UpdateConfuseRayBallBlend(sprite); + } } static void UpdateConfuseRayBallBlend(struct Sprite *sprite) diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index 951794fc54c9..956020b30503 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -1147,7 +1147,9 @@ static void SpriteCB_Ball_Wobble_Step(struct Sprite *sprite) gBattleSpritesDataPtr->animationData->ballSubpx &= 0xFF; } else + { gBattleSpritesDataPtr->animationData->ballSubpx += 176; + } sprite->sTimer++; sprite->affineAnimPaused = FALSE; @@ -1172,7 +1174,9 @@ static void SpriteCB_Ball_Wobble_Step(struct Sprite *sprite) ChangeSpriteAffineAnim(sprite, BALL_ROTATE_RIGHT); } else + { sprite->affineAnimPaused = TRUE; + } break; case BALL_ROLL_2: if (gBattleSpritesDataPtr->animationData->ballSubpx > 255) @@ -1181,7 +1185,9 @@ static void SpriteCB_Ball_Wobble_Step(struct Sprite *sprite) gBattleSpritesDataPtr->animationData->ballSubpx &= 0xFF; } else + { gBattleSpritesDataPtr->animationData->ballSubpx += 176; + } sprite->sTimer++; sprite->affineAnimPaused = FALSE; @@ -1216,7 +1222,9 @@ static void SpriteCB_Ball_Wobble_Step(struct Sprite *sprite) gBattleSpritesDataPtr->animationData->ballSubpx &= 0xFF; } else + { gBattleSpritesDataPtr->animationData->ballSubpx += 176; + } sprite->sTimer++; sprite->affineAnimPaused = FALSE; @@ -1390,7 +1398,9 @@ static void SpriteCB_Ball_FadeOut(struct Sprite *sprite) static void DestroySpriteAfterOneFrame(struct Sprite *sprite) { if (sprite->sFrame == 0) + { sprite->sFrame = -1; + } else { FreeSpriteOamMatrix(sprite); @@ -1410,7 +1420,9 @@ static void MakeCaptureStars(struct Sprite *sprite) u8 subpriority; if (sprite->subpriority) + { subpriority = sprite->subpriority - 1; + } else { subpriority = 0; @@ -2358,7 +2370,9 @@ static void SpriteCB_ShinyStars_Diagonal(struct Sprite *sprite) { // Delayed four frames to de-sync from encircling stars if (sprite->sTimer < 4) + { sprite->sTimer++; + } else { sprite->invisible = FALSE; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index dc3652b4575f..c01dcb442f69 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -257,7 +257,9 @@ static void Intro_WaitForShinyAnimAndHealthbox(void) FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); } else + { return; + } } else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim) { @@ -270,13 +272,17 @@ static void Intro_WaitForShinyAnimAndHealthbox(void) FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS); } else + { return; + } } - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; - gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE; + gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE; } else + { return; + } gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3; gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd; @@ -331,7 +337,9 @@ static void Intro_TryShinyAnimShowHealthbox(void) m4aMPlayContinue(&gMPlayInfo_BGM); } else + { m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x100); + } } gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored = TRUE; bgmRestored = TRUE; diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index ed8cf572ea71..2deced13c00d 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -773,13 +773,21 @@ bool8 BattleLoadAllHealthBoxesGfx(u8 state) LoadCompressedSpriteSheet(&sSpriteSheet_SinglesPlayerHealthbox); } else if (state == 3) + { LoadCompressedSpriteSheet(&sSpriteSheet_SinglesOpponentHealthbox); + } else if (state == 4) + { LoadCompressedSpriteSheet(&sSpriteSheets_HealthBar[gBattlerPositions[0]]); + } else if (state == 5) + { LoadCompressedSpriteSheet(&sSpriteSheets_HealthBar[gBattlerPositions[1]]); + } else + { retVal = TRUE; + } } else { diff --git a/src/battle_main.c b/src/battle_main.c index 7ee8d8cf55a3..25b1cfa8448c 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -1654,7 +1654,9 @@ static void CB2_HandleStartMultiBattle(void) gBattleCommunication[MULTIUSE_STATE]++; } else + { break; + } // fall through case 3: if (IsLinkTaskFinished()) @@ -3084,7 +3086,9 @@ static void BattleStartClearSetData(void) gHitMarker |= HITMARKER_NO_ANIMATIONS; } else if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)) && GetBattleSceneInRecordedBattle()) + { gHitMarker |= HITMARKER_NO_ANIMATIONS; + } gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle; @@ -3584,7 +3588,9 @@ static void BattleIntroPrintOpponentSendsOut(void) return; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) + { position = B_POSITION_OPPONENT_LEFT; + } else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK) { if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER) @@ -3593,7 +3599,9 @@ static void BattleIntroPrintOpponentSendsOut(void) position = B_POSITION_PLAYER_LEFT; } else + { position = B_POSITION_OPPONENT_LEFT; + } PrepareStringBattle(STRINGID_INTROSENDOUT, GetBattlerAtPosition(position)); gBattleMainFunc = BattleIntroOpponent1SendsOutMonAnimation; @@ -3604,7 +3612,9 @@ static void BattleIntroOpponent2SendsOutMonAnimation(void) u32 position; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) + { position = B_POSITION_OPPONENT_RIGHT; + } else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK) { if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER) @@ -3613,7 +3623,9 @@ static void BattleIntroOpponent2SendsOutMonAnimation(void) position = B_POSITION_PLAYER_RIGHT; } else + { position = B_POSITION_OPPONENT_RIGHT; + } for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++) { @@ -3641,10 +3653,14 @@ static void BattleIntroOpponent1SendsOutMonAnimation(void) position = B_POSITION_PLAYER_LEFT; } else + { position = B_POSITION_OPPONENT_LEFT; + } } else + { position = B_POSITION_OPPONENT_LEFT; + } if (gBattleControllerExecFlags) return; @@ -3699,7 +3715,9 @@ static void BattleIntroPrintPlayerSendsOut(void) u8 position; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) + { position = B_POSITION_PLAYER_LEFT; + } else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK) { if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER) @@ -3708,7 +3726,9 @@ static void BattleIntroPrintPlayerSendsOut(void) position = B_POSITION_OPPONENT_LEFT; } else + { position = B_POSITION_PLAYER_LEFT; + } if (!(gBattleTypeFlags & BATTLE_TYPE_SAFARI)) PrepareStringBattle(STRINGID_INTROSENDOUT, GetBattlerAtPosition(position)); @@ -3722,7 +3742,9 @@ static void BattleIntroPlayer2SendsOutMonAnimation(void) u32 position; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) + { position = B_POSITION_PLAYER_RIGHT; + } else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK) { if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER) @@ -3731,7 +3753,9 @@ static void BattleIntroPlayer2SendsOutMonAnimation(void) position = B_POSITION_OPPONENT_RIGHT; } else + { position = B_POSITION_PLAYER_RIGHT; + } for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++) { @@ -3754,7 +3778,9 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void) u32 position; if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) + { position = B_POSITION_PLAYER_LEFT; + } else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK) { if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_IS_MASTER) @@ -3763,7 +3789,9 @@ static void BattleIntroPlayer1SendsOutMonAnimation(void) position = B_POSITION_OPPONENT_LEFT; } else + { position = B_POSITION_PLAYER_LEFT; + } if (gBattleControllerExecFlags) return; @@ -4678,7 +4706,9 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) moveBattler1 = gBattleMons[battler1].moves[*(gBattleStruct->chosenMovePositions + battler1)]; } else + { moveBattler1 = MOVE_NONE; + } if (gChosenActionByBattler[battler2] == B_ACTION_USE_MOVE) { @@ -4688,7 +4718,9 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) moveBattler2 = gBattleMons[battler2].moves[*(gBattleStruct->chosenMovePositions + battler2)]; } else + { moveBattler2 = MOVE_NONE; + } } // both move priorities are different than 0 @@ -4705,7 +4737,9 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) // else battler1 has more speed } else if (gBattleMoves[moveBattler1].priority < gBattleMoves[moveBattler2].priority) + { strikesFirst = 1; // battler2's move has greater priority + } // else battler1's move has greater priority } diff --git a/src/battle_message.c b/src/battle_message.c index e50fcff3de0b..d539bc540dcc 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -2350,7 +2350,9 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) toCpy = gStringVar2; } else + { toCpy = gBattleTextBuff2; + } break; case B_TXT_BUFF3: if (gBattleTextBuff3[0] == B_BUFF_PLACEHOLDER_BEGIN) @@ -2359,7 +2361,9 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) toCpy = gStringVar3; } else + { toCpy = gBattleTextBuff3; + } break; case B_TXT_COPY_VAR_1: toCpy = gStringVar1; @@ -2486,7 +2490,9 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) toCpy = text; } else + { toCpy = sText_EnigmaBerry; + } } } else diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6f43c6af706b..1891ea92857d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1769,7 +1769,9 @@ static void Cmd_attackanimation(void) gActiveBattler = gBattlerAttacker; if (gBattleMons[gBattlerTarget].status2 & STATUS2_SUBSTITUTE) + { multihit = gMultiHitCounter; + } else if (gMultiHitCounter != 0 && gMultiHitCounter != 1) { if (gBattleMons[gBattlerTarget].hp <= gBattleMoveDamage) @@ -1778,7 +1780,9 @@ static void Cmd_attackanimation(void) multihit = gMultiHitCounter; } else + { multihit = gMultiHitCounter; + } BtlController_EmitMoveAnimation(BUFFER_A, gCurrentMove, gBattleScripting.animTurn, gBattleMovePower, gBattleMoveDamage, gBattleMons[gBattlerAttacker].friendship, &gDisableStructs[gBattlerAttacker], multihit); gBattleScripting.animTurn++; @@ -2276,7 +2280,9 @@ void SetMoveEffect(bool8 primary, u8 certain) {} } else + { gActiveBattler = gBattlersCount; + } if (gBattleMons[gEffectBattler].status1) break; @@ -2409,7 +2415,9 @@ void SetMoveEffect(bool8 primary, u8 certain) RESET_RETURN } else + { break; + } } if (gBattleMons[gEffectBattler].status1) break; @@ -3111,7 +3119,9 @@ static void Cmd_jumpifability(void) gBattleScripting.battlerWithAbility = battlerId - 1; } else + { gBattlescriptCurrInstr += 7; + } } else if (gBattlescriptCurrInstr[1] == BS_NOT_ATTACKER_SIDE) { @@ -3124,7 +3134,9 @@ static void Cmd_jumpifability(void) gBattleScripting.battlerWithAbility = battlerId - 1; } else + { gBattlescriptCurrInstr += 7; + } } else { @@ -3137,7 +3149,9 @@ static void Cmd_jumpifability(void) gBattleScripting.battlerWithAbility = battlerId; } else + { gBattlescriptCurrInstr += 7; + } } } @@ -3387,13 +3401,10 @@ static void Cmd_getexp(void) { if (gBattlerPartyIndexes[2] == gBattleStruct->expGetterMonId && !(gAbsentBattlerFlags & gBitTable[2])) gBattleStruct->expGetterBattlerId = 2; + else if (!(gAbsentBattlerFlags & gBitTable[0])) + gBattleStruct->expGetterBattlerId = 0; else - { - if (!(gAbsentBattlerFlags & gBitTable[0])) - gBattleStruct->expGetterBattlerId = 0; - else - gBattleStruct->expGetterBattlerId = 2; - } + gBattleStruct->expGetterBattlerId = 2; } else { @@ -8558,11 +8569,17 @@ static void Cmd_presentdamagecalculation(void) s32 rand = Random() & 0xFF; if (rand < 102) + { gDynamicBasePower = 40; + } else if (rand < 178) + { gDynamicBasePower = 80; + } else if (rand < 204) + { gDynamicBasePower = 120; + } else { gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 4; @@ -8570,10 +8587,15 @@ static void Cmd_presentdamagecalculation(void) gBattleMoveDamage = 1; gBattleMoveDamage *= -1; } + if (rand < 204) + { gBattlescriptCurrInstr = BattleScript_HitFromCritCalc; + } else if (gBattleMons[gBattlerTarget].maxHP == gBattleMons[gBattlerTarget].hp) + { gBattlescriptCurrInstr = BattleScript_AlreadyAtFullHp; + } else { gMoveResultFlags &= ~MOVE_RESULT_DOESNT_AFFECT_FOE; @@ -8910,6 +8932,7 @@ static void Cmd_trydobeatup(void) && !GetMonData(&party[gBattleCommunication[0]], MON_DATA_STATUS)) break; } + if (gBattleCommunication[0] < PARTY_SIZE) { PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattleCommunication[0]) @@ -8927,9 +8950,13 @@ static void Cmd_trydobeatup(void) gBattleCommunication[0]++; } else if (beforeLoop != 0) + { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); + } else + { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + } } } @@ -9907,7 +9934,9 @@ static void Cmd_handleballthrow(void) } } else + { ballMultiplier = sBallCatchBonuses[gLastUsedItem - ITEM_ULTRA_BALL]; + } odds = (catchRate * ballMultiplier / 10) * (gBattleMons[gBattlerTarget].maxHP * 3 - gBattleMons[gBattlerTarget].hp * 2) diff --git a/src/battle_util.c b/src/battle_util.c index d79c61b38253..6e201a2956a1 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1336,9 +1336,13 @@ u8 DoFieldEndTurnEffects(void) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_STOPPED; } else if (gBattleWeather & B_WEATHER_RAIN_DOWNPOUR) + { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DOWNPOUR_CONTINUES; + } else + { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_RAIN_CONTINUES; + } } else if (gBattleWeather & B_WEATHER_RAIN_DOWNPOUR) { @@ -3824,7 +3828,9 @@ u8 GetMoveTarget(u16 move, u8 setTarget) case MOVE_TARGET_SELECTED: side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker)); if (gSideTimers[side].followmeTimer && gBattleMons[gSideTimers[side].followmeTarget].hp) + { targetBattler = gSideTimers[side].followmeTarget; + } else { side = GetBattlerSide(gBattlerAttacker); @@ -3853,7 +3859,9 @@ u8 GetMoveTarget(u16 move, u8 setTarget) case MOVE_TARGET_RANDOM: side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker)); if (gSideTimers[side].followmeTimer && gBattleMons[gSideTimers[side].followmeTarget].hp) + { targetBattler = gSideTimers[side].followmeTarget; + } else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && moveTarget & MOVE_TARGET_RANDOM) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) @@ -3874,7 +3882,9 @@ u8 GetMoveTarget(u16 move, u8 setTarget) targetBattler ^= BIT_FLANK; } else + { targetBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GET_BATTLER_SIDE(gBattlerAttacker))); + } break; case MOVE_TARGET_USER_OR_SELECTED: case MOVE_TARGET_USER: diff --git a/src/berry.c b/src/berry.c index 389a09a10644..543041e52687 100644 --- a/src/berry.c +++ b/src/berry.c @@ -980,7 +980,9 @@ bool32 IsEnigmaBerryValid(void) const struct Berry *GetBerryInfo(u8 berry) { if (berry == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) && IsEnigmaBerryValid()) + { return (struct Berry *)(&gSaveBlock1Ptr->enigmaBerry.berry); + } else { if (berry == BERRY_NONE || berry > ITEM_TO_BERRY(LAST_BERRY_INDEX)) @@ -1219,7 +1221,9 @@ static u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water) u32 extraYield; if (water == 0) + { return min; + } else { randMin = (max - min) * (water - 1); diff --git a/src/berry_crush.c b/src/berry_crush.c index 05e708162d55..c7bff2abcdbe 100644 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -3398,7 +3398,9 @@ static u32 Cmd_StopGame(struct BerryCrushGame *game, u8 *args) break; case 2: if (game->gfx.counter != 0) + { game->gfx.counter--; + } else { RunOrScheduleCommand(CMD_CLOSE_LINK, SCHEDULE_CMD, NULL); diff --git a/src/bike.c b/src/bike.c index ae9dfd3e9170..d8a3d1ab5221 100644 --- a/src/bike.c +++ b/src/bike.c @@ -372,7 +372,9 @@ static u8 AcroBikeHandleInputWheelieStanding(u8 *newDirection, u16 newKeys, u16 gPlayerAvatar.runningState = NOT_MOVING; if (heldKeys & B_BUTTON) + { gPlayerAvatar.bikeFrameCounter++; + } else { // B button was released. diff --git a/src/contest.c b/src/contest.c index 40a42a35292b..0615f7b50475 100644 --- a/src/contest.c +++ b/src/contest.c @@ -2667,7 +2667,9 @@ static void Task_EndAppeals(u8 taskId) CalculateFinalScores(); ContestClearGeneralTextWindow(); if (!(gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK)) + { BravoTrainerPokemonProfile_BeforeInterview1(eContestantStatus[gContestPlayerMonIndex].prevMove); + } else { CalculateContestLiveUpdateData(); diff --git a/src/contest_effect.c b/src/contest_effect.c index 24de8e169291..92cc5a169c49 100644 --- a/src/contest_effect.c +++ b/src/contest_effect.c @@ -619,15 +619,18 @@ static void ContestEffect_QualityDependsOnTiming(void) { appeal = 10; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_NOT_VERY_WELL); - } else if (rval < 6) + } + else if (rval < 6) { appeal = 20; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_SLIGHTLY_WELL2); - } else if (rval < 8) + } + else if (rval < 8) { appeal = 40; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_PRETTY_WELL2); - } else if (rval < 9) + } + else if (rval < 9) { appeal = 60; SetContestantEffectStringID(eContestAppealResults.contestant, CONTEST_STRING_APPEAL_VERY_WELL); @@ -868,7 +871,9 @@ static void ContestEffect_ScrambleNextTurnOrder(void) break; } else + { rval--; + } } } } @@ -908,7 +913,9 @@ static void ContestEffect_BadlyStartleMonsWithGoodAppeals(void) eContestAppealResults.jam = RoundUp(eContestAppealResults.jam); } else + { eContestAppealResults.jam = 10; + } eContestAppealResults.jamQueue[0] = i; eContestAppealResults.jamQueue[1] = CONTESTANT_NONE; if (WasAtLeastOneOpponentJammed()) @@ -1071,7 +1078,9 @@ static s16 RoundTowardsZero(s16 score) score -= 10 - absScore; } else + { score -= absScore; + } return score; } diff --git a/src/decompress.c b/src/decompress.c index 55807e89bb05..491ae8587f77 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -100,9 +100,13 @@ void LoadSpecialPokePic(const struct CompressedSpriteSheet *src, void *dest, s32 LZ77UnCompWram(gMonFrontPicTable[i].data, dest); } else if (species > NUM_SPECIES) // is species unknown? draw the ? icon + { LZ77UnCompWram(gMonFrontPicTable[0].data, dest); + } else + { LZ77UnCompWram(src->data, dest); + } DuplicateDeoxysTiles(dest, species); DrawSpindaSpots(species, personality, dest, isFrontPic); @@ -327,9 +331,13 @@ void LoadSpecialPokePic_2(const struct CompressedSpriteSheet *src, void *dest, s LZ77UnCompWram(gMonFrontPicTable[i].data, dest); } else if (species > NUM_SPECIES) // is species unknown? draw the ? icon + { LZ77UnCompWram(gMonFrontPicTable[0].data, dest); + } else + { LZ77UnCompWram(src->data, dest); + } DuplicateDeoxysTiles(dest, species); DrawSpindaSpots(species, personality, dest, isFrontPic); @@ -385,9 +393,13 @@ void LoadSpecialPokePic_DontHandleDeoxys(const struct CompressedSpriteSheet *src LZ77UnCompWram(gMonFrontPicTable[i].data, dest); } else if (species > NUM_SPECIES) // is species unknown? draw the ? icon + { LZ77UnCompWram(gMonFrontPicTable[0].data, dest); + } else + { LZ77UnCompWram(src->data, dest); + } DrawSpindaSpots(species, personality, dest, isFrontPic); } diff --git a/src/evolution_graphics.c b/src/evolution_graphics.c index 96ff1b52df80..1568c18d5fba 100644 --- a/src/evolution_graphics.c +++ b/src/evolution_graphics.c @@ -150,7 +150,9 @@ static void SpriteCB_Sparkle_SpiralUpward(struct Sprite *sprite) sprite->oam.matrixNum = matrixNum; } else + { DestroySprite(sprite); + } } static void CreateSparkle_SpiralUpward(u8 trigIdx) @@ -178,7 +180,9 @@ static void SpriteCB_Sparkle_ArcDown(struct Sprite *sprite) sprite->sTimer++; } else + { DestroySprite(sprite); + } } static void CreateSparkle_ArcDown(u8 trigIdx) @@ -206,7 +210,9 @@ static void SpriteCB_Sparkle_CircleInward(struct Sprite *sprite) sprite->sTrigIdx += 4; } else + { DestroySprite(sprite); + } } static void CreateSparkle_CircleInward(u8 trigIdx, u8 speed) @@ -238,7 +244,9 @@ static void SpriteCB_Sparkle_Spray(struct Sprite *sprite) sprite->sTrigIdx++; matrixNum = 31 - (sprite->sTrigIdx * 12 / 128); if (sprite->sTrigIdx > 64) + { sprite->subpriority = 1; + } else { sprite->invisible = FALSE; @@ -252,7 +260,9 @@ static void SpriteCB_Sparkle_Spray(struct Sprite *sprite) sprite->sTimer++; } else + { DestroySprite(sprite); + } } static void CreateSparkle_Spray(u8 id) @@ -348,7 +358,9 @@ static void Task_Sparkles_ArcDown(u8 taskId) gTasks[taskId].tTimer++; } else + { gTasks[taskId].func = Task_Sparkles_ArcDown_End; + } } static void Task_Sparkles_ArcDown_End(u8 taskId) @@ -388,7 +400,9 @@ static void Task_Sparkles_CircleInward(u8 taskId) gTasks[taskId].tTimer++; } else + { gTasks[taskId].func = Task_Sparkles_CircleInward_End; + } } static void Task_Sparkles_CircleInward_End(u8 taskId) @@ -437,7 +451,9 @@ static void Task_Sparkles_SprayAndFlash(u8 taskId) gTasks[taskId].tTimer++; } else + { gTasks[taskId].func = Task_Sparkles_SprayAndFlash_End; + } } static void Task_Sparkles_SprayAndFlash_End(u8 taskId) @@ -486,7 +502,9 @@ static void Task_Sparkles_SprayAndFlashTrade(u8 taskId) gTasks[taskId].tTimer++; } else + { gTasks[taskId].func = Task_Sparkles_SprayAndFlash_End; + } } #undef tTimer @@ -560,9 +578,13 @@ static void Task_CycleEvolutionMonSprite_Init(u8 taskId) static void Task_CycleEvolutionMonSprite_TryEnd(u8 taskId) { if (gTasks[taskId].tEvoStopped) + { EndOnPreEvoMon(taskId); + } else if (gTasks[taskId].tScaleSpeed == 128) + { EndOnPostEvoMon(taskId); + } else { gTasks[taskId].tScaleSpeed += 2; @@ -574,7 +596,9 @@ static void Task_CycleEvolutionMonSprite_TryEnd(u8 taskId) static void Task_CycleEvolutionMonSprite_UpdateSize(u8 taskId) { if (gTasks[taskId].tEvoStopped) + { gTasks[taskId].func = EndOnPreEvoMon; + } else { u16 oamMatrixArg; @@ -583,7 +607,9 @@ static void Task_CycleEvolutionMonSprite_UpdateSize(u8 taskId) { // Set pre-evo sprite growth if (gTasks[taskId].tPreEvoScale < MON_MAX_SCALE - gTasks[taskId].tScaleSpeed) + { gTasks[taskId].tPreEvoScale += gTasks[taskId].tScaleSpeed; + } else { gTasks[taskId].tPreEvoScale = MON_MAX_SCALE; @@ -592,7 +618,9 @@ static void Task_CycleEvolutionMonSprite_UpdateSize(u8 taskId) // Set post-evo sprite shrink if (gTasks[taskId].tPostEvoScale > MON_MIN_SCALE + gTasks[taskId].tScaleSpeed) + { gTasks[taskId].tPostEvoScale -= gTasks[taskId].tScaleSpeed; + } else { gTasks[taskId].tPostEvoScale = MON_MIN_SCALE; @@ -603,7 +631,9 @@ static void Task_CycleEvolutionMonSprite_UpdateSize(u8 taskId) { // Set post-evo sprite growth if (gTasks[taskId].tPostEvoScale < MON_MAX_SCALE - gTasks[taskId].tScaleSpeed) + { gTasks[taskId].tPostEvoScale += gTasks[taskId].tScaleSpeed; + } else { gTasks[taskId].tPostEvoScale = MON_MAX_SCALE; @@ -612,7 +642,9 @@ static void Task_CycleEvolutionMonSprite_UpdateSize(u8 taskId) // Set pre-evo sprite shrink if (gTasks[taskId].tPreEvoScale > MON_MIN_SCALE + gTasks[taskId].tScaleSpeed) + { gTasks[taskId].tPreEvoScale -= gTasks[taskId].tScaleSpeed; + } else { gTasks[taskId].tPreEvoScale = MON_MIN_SCALE; diff --git a/src/field_camera.c b/src/field_camera.c index 290ddddaf178..e76ba3d855cd 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -231,7 +231,9 @@ static void DrawMetatileAt(const struct MapLayout *mapLayout, u16 offset, int x, if (metatileId > NUM_METATILES_TOTAL) metatileId = 0; if (metatileId < NUM_METATILES_IN_PRIMARY) + { metatiles = mapLayout->primaryTileset->metatiles; + } else { metatiles = mapLayout->secondaryTileset->metatiles; diff --git a/src/field_door.c b/src/field_door.c index 255233ec2346..908a65a453ea 100644 --- a/src/field_door.c +++ b/src/field_door.c @@ -437,7 +437,9 @@ static const struct DoorGraphics *GetDoorGraphics(const struct DoorGraphics *gfx static s8 StartDoorAnimationTask(const struct DoorGraphics *gfx, const struct DoorAnimFrame *frames, u32 x, u32 y) { if (FuncIsActiveTask(Task_AnimateDoor) == TRUE) + { return -1; + } else { u8 taskId = CreateTask(Task_AnimateDoor, 0x50); diff --git a/src/field_effect.c b/src/field_effect.c index d907c3f16da3..5dcc4b3c080e 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -1293,7 +1293,8 @@ static void CreateHofMonitorSprite(s16 taskId, s16 x, s16 y, bool8 isSmallMonito { spriteId = CreateSpriteAtEnd(&sSpriteTemplate_HofMonitorBig, x, y, 0); SetSubspriteTables(&gSprites[spriteId], &sSubspriteTable_HofMonitorBig); - } else + } + else { spriteId = CreateSpriteAtEnd(&sSpriteTemplate_HofMonitorSmall, x, y, 0); } @@ -2003,7 +2004,8 @@ static bool8 LavaridgeGymB1FWarpEffect_Rise(struct Task *task, struct ObjectEven { task->data[1] <<= 1; } - } else if (!(task->data[2] & 4) && (task->data[1] > 0)) + } + else if (!(task->data[2] & 4) && (task->data[1] > 0)) { task->data[1] >>= 1; } @@ -2017,7 +2019,8 @@ static bool8 LavaridgeGymB1FWarpEffect_Rise(struct Task *task, struct ObjectEven { task->data[3]++; } - } else + } + else { task->data[4] = 1; } @@ -2169,7 +2172,8 @@ static bool8 LavaridgeGym1FWarpEffect_AshPuff(struct Task *task, struct ObjectEv gFieldEffectArguments[3] = sprite->oam.priority; task->data[1] = FieldEffectStart(FLDEFF_ASH_PUFF); task->data[0]++; - } else + } + else { task->data[1]++; ObjectEventSetHeldMovement(objectEvent, GetWalkInPlaceFasterMovementAction(objectEvent->facingDirection)); @@ -2499,7 +2503,8 @@ static void TeleportWarpInFieldEffect_SpinEnter(struct Task *task) objectEvent->triggerGroundEffectsOnMove = TRUE; sprite->subspriteMode = task->data[14]; } - } else + } + else { sprite->oam.priority = 1; if (sprite->subspriteMode != SUBSPRITES_OFF) diff --git a/src/item_use.c b/src/item_use.c index abd80e0eae3b..322eaf76c072 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -122,7 +122,9 @@ static void SetUpItemUseOnFieldCallback(u8 taskId) SetUpItemUseCallback(taskId); } else + { sItemUseOnFieldCB(taskId); + } } static void FieldCB_UseItemOnField(void) @@ -148,7 +150,9 @@ static void DisplayCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyIte DisplayItemMessageInBattlePyramid(taskId, gText_DadsAdvice, Task_CloseBattlePyramidBagMessage); } else + { DisplayItemMessageOnField(taskId, gStringVar4, Task_CloseCantUseKeyItemMessage); + } } static void DisplayDadsAdviceCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField) @@ -202,7 +206,9 @@ void ItemUseOutOfBattle_Bike(u8 taskId) PlayerGetDestCoords(&coordsX, &coordsY); behavior = MapGridGetMetatileBehaviorAt(coordsX, coordsY); if (FlagGet(FLAG_SYS_CYCLING_ROAD) == TRUE || MetatileBehavior_IsVerticalRail(behavior) == TRUE || MetatileBehavior_IsHorizontalRail(behavior) == TRUE || MetatileBehavior_IsIsolatedVerticalRail(behavior) == TRUE || MetatileBehavior_IsIsolatedHorizontalRail(behavior) == TRUE) + { DisplayCannotDismountBikeMessage(taskId, tUsingRegisteredKeyItem); + } else { if (Overworld_IsBikingAllowed() == TRUE && IsBikingDisallowedByPlayer() == 0) @@ -211,7 +217,9 @@ void ItemUseOutOfBattle_Bike(u8 taskId) SetUpItemUseOnFieldCallback(taskId); } else + { DisplayDadsAdviceCannotUseItemMessage(taskId, tUsingRegisteredKeyItem); + } } } @@ -264,7 +272,9 @@ void ItemUseOutOfBattle_Rod(u8 taskId) SetUpItemUseOnFieldCallback(taskId); } else + { DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].tUsingRegisteredKeyItem); + } } static void ItemUseOnFieldCB_Rod(u8 taskId) @@ -951,7 +961,9 @@ void ItemUseInBattle_PokeBall(u8 taskId) DisplayItemMessage(taskId, FONT_NORMAL, gText_BoxFull, CloseItemMessage); } else + { DisplayItemMessageInBattlePyramid(taskId, gText_BoxFull, Task_CloseBattlePyramidBagMessage); + } } static void Task_CloseStatIncreaseMessage(u8 taskId) diff --git a/src/librfu_sio32id.c b/src/librfu_sio32id.c index 32391d781c43..c40bb825b3e1 100644 --- a/src/librfu_sio32id.c +++ b/src/librfu_sio32id.c @@ -145,7 +145,9 @@ static void Sio32IDIntr(void) } } else + { gRfuSIO32Id.lastId = regSIODATA32; + } } else { diff --git a/src/link_rfu_2.c b/src/link_rfu_2.c index 4c4323c1edc7..6b20cf967814 100644 --- a/src/link_rfu_2.c +++ b/src/link_rfu_2.c @@ -1175,7 +1175,9 @@ static void RfuHandleReceiveCommand(u8 unused) gRfu.numBlocksReceived[i] = 0; } else + { gRfu.numBlocksReceived[i]++; + } } } } @@ -1302,7 +1304,9 @@ bool32 Rfu_InitBlockSend(const u8 *src, size_t size) gRfu.sendBlock.count = (size / 12) + r4; gRfu.sendBlock.next = 0; if (size > BLOCK_BUFFER_SIZE) + { gRfu.sendBlock.payload = src; + } else { if (src != gBlockSendBuffer) @@ -1629,9 +1633,8 @@ static bool8 CheckForLeavingGroupMembers(void) } else if (gRfuSlotStatusNI[gRfu.childSlot]->recv.state == SLOT_STATE_RECV_FAILED) - rfu_clearSlot(TYPE_NI_RECV, i); { - + rfu_clearSlot(TYPE_NI_RECV, i); } } } @@ -1777,7 +1780,9 @@ static void Task_PlayerExchange(u8 taskId) gTasks[taskId].tState = 101; } else + { gTasks[taskId].tState = 2; + } break; case 101: if (gSendCmd[0] == 0) @@ -1798,7 +1803,9 @@ static void Task_PlayerExchange(u8 taskId) } } else + { gTasks[taskId].tState++; + } break; case 4: if (AreAllPlayersFinishedReceiving()) diff --git a/src/lottery_corner.c b/src/lottery_corner.c index 052e2cfc382b..117a5d633195 100644 --- a/src/lottery_corner.c +++ b/src/lottery_corner.c @@ -76,7 +76,9 @@ void PickLotteryCornerTicket(void) } } else // Pokémon are always arranged from populated spots first to unpopulated, so the moment a NONE species is found, that's the end of the list. + { break; + } } for (i = 0; i < TOTAL_BOXES_COUNT; i++) @@ -134,7 +136,9 @@ static u8 GetMatchingDigits(u16 winNumber, u16 otId) matchingDigits++; } else + { break; + } } return matchingDigits; } diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index dda6e6bffaf7..7338afb94b22 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -481,7 +481,9 @@ static void BardSing(struct Task *task, struct BardSong *song) GetWordPhonemes(song, MACRO1(word)); song->currWord++; if (song->sound->songLengthId != 0xFF) + { song->state = 0; + } else { song->state = 3; @@ -531,7 +533,9 @@ static void BardSing(struct Task *task, struct BardSong *song) { song->currPhoneme++; if (song->currPhoneme != 6 && song->sound[song->currPhoneme].songLengthId != 0xFF) + { song->state = 0; + } else { song->state = 3; @@ -850,7 +854,9 @@ void SanitizeReceivedRubyOldMan(union OldMan * oldMan, u32 version, u32 language trader->language[i] = LANGUAGE_JAPANESE; } else + { trader->language[i] = language; + } } } else diff --git a/src/mini_printf.c b/src/mini_printf.c index e4b893724284..17665cdf06c2 100644 --- a/src/mini_printf.c +++ b/src/mini_printf.c @@ -167,9 +167,9 @@ static s32 _putsEncoded(char *s, s32 len, void *buf) static s32 mini_strlen(const char *s) { - s32 len = 0; - while (s[len] != '\0') len++; - return len; + s32 len = 0; + while (s[len] != '\0') len++; + return len; } static s32 mini_itoa(s32 value, u32 radix, s32 uppercase, bool32 unsig, char *buffer) @@ -274,7 +274,8 @@ s32 mini_vpprintf(void* buf, const char *fmt, va_list va) { len = 1; len = _putsAscii(&ch, len, buf); - } else + } + else { char pad_char = ' '; s32 pad_to = 0; @@ -310,7 +311,8 @@ s32 mini_vpprintf(void* buf, const char *fmt, va_list va) if(l) { len = mini_itoa(va_arg(va, u32), 10, 0, (ch=='u'), bf2); - } else + } + else { if(ch == 'u') { @@ -352,7 +354,8 @@ s32 mini_vpprintf(void* buf, const char *fmt, va_list va) { len = mini_pad(ptr, len, pad_char, pad_to, bf); len = _putsAscii(bf, len, buf); - } else + } + else { len = _putsAscii(ptr, len, buf); } @@ -364,7 +367,8 @@ s32 mini_vpprintf(void* buf, const char *fmt, va_list va) { len = mini_pad(ptr, len, pad_char, pad_to, bf); len = _putsEncoded(bf, len, buf); - } else + } + else { len = _putsEncoded(ptr, len, buf); } diff --git a/src/party_menu.c b/src/party_menu.c index 56625d09a3f9..cbd469713a93 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -4800,7 +4800,9 @@ static void Task_LearnNextMoveOrClosePartyMenu(u8 taskId) if (IsFanfareTaskInactive() && ((JOY_NEW(A_BUTTON)) || (JOY_NEW(B_BUTTON)))) { if (gPartyMenu.learnMoveState == 1) + { Task_TryLearningNextMove(taskId); + } else { if (gPartyMenu.learnMoveState == 2) // never occurs diff --git a/src/player_pc.c b/src/player_pc.c index 009aa7810f79..81170a86c920 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -880,7 +880,9 @@ static void Mailbox_CancelMoveToBag(u8 taskId) static void Mailbox_Give(u8 taskId) { if (CalculatePlayerPartyCount() == 0) + { Mailbox_NoPokemonForMail(taskId); + } else { FadeScreen(FADE_TO_BLACK, 0); diff --git a/src/pokedex.c b/src/pokedex.c index c0b20bf9d6b3..030020df8913 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2396,7 +2396,9 @@ static void CreateMonListEntry(u8 position, u16 b, u16 ignored) if (vOffset >= LIST_SCROLL_STEP) vOffset -= LIST_SCROLL_STEP; if (entryNum < 0 || entryNum >= NATIONAL_DEX_COUNT || sPokedexView->pokedexList[entryNum].dexNum == 0xFFFF) + { ClearMonListEntry(17, vOffset * 2, ignored); + } else { ClearMonListEntry(17, vOffset * 2, ignored); @@ -2685,7 +2687,9 @@ static bool8 TryDoInfoScreenScroll(void) } if (sPokedexView->selectedPokemon == selectedPokemon) + { return FALSE; + } else { sPokedexView->selectedPokemon = selectedPokemon; @@ -2708,7 +2712,9 @@ static bool8 TryDoInfoScreenScroll(void) } if (sPokedexView->selectedPokemon == selectedPokemon) + { return FALSE; + } else { sPokedexView->selectedPokemon = selectedPokemon; diff --git a/src/pokemon.c b/src/pokemon.c index d59f46ada1be..e98182b0ae3b 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2874,8 +2874,11 @@ void CalculateMonStats(struct Pokemon *mon) else { if (currentHP == 0 && oldMaxHP == 0) + { currentHP = newMaxHP; - else if (currentHP != 0) { + } + else if (currentHP != 0) + { // BUG: currentHP is unintentionally able to become <= 0 after the instruction below. This causes the pomeg berry glitch. currentHP += newMaxHP - oldMaxHP; #ifdef BUGFIX @@ -2884,7 +2887,9 @@ void CalculateMonStats(struct Pokemon *mon) #endif } else + { return; + } } SetMonData(mon, MON_DATA_HP, ¤tHP); @@ -6394,11 +6399,17 @@ void ClearBattleMonForms(void) u16 GetBattleBGM(void) { if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON) + { return MUS_VS_KYOGRE_GROUDON; + } else if (gBattleTypeFlags & BATTLE_TYPE_REGI) + { return MUS_VS_REGI; + } else if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK)) + { return MUS_VS_TRAINER; + } else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER) { u8 trainerClass; @@ -6445,7 +6456,9 @@ u16 GetBattleBGM(void) } } else + { return MUS_VS_WILD; + } } void PlayBattleBGM(void) diff --git a/src/pokenav_conditions_search_results.c b/src/pokenav_conditions_search_results.c index 181739802004..e42f35481bb3 100644 --- a/src/pokenav_conditions_search_results.c +++ b/src/pokenav_conditions_search_results.c @@ -184,13 +184,21 @@ static bool32 HandleConditionSearchInput_WaitSetup(struct Pokenav_SearchResults static u32 HandleConditionSearchInput(struct Pokenav_SearchResults *menu) { if (JOY_REPEAT(DPAD_UP)) + { return CONDITION_SEARCH_FUNC_MOVE_UP; + } else if (JOY_REPEAT(DPAD_DOWN)) + { return CONDITION_SEARCH_FUNC_MOVE_DOWN; + } else if (JOY_NEW(DPAD_LEFT)) + { return CONDITION_SEARCH_FUNC_PAGE_UP; + } else if (JOY_NEW(DPAD_RIGHT)) + { return CONDITION_SEARCH_FUNC_PAGE_DOWN; + } else if (JOY_NEW(B_BUTTON)) { // Exiting back to main search menu @@ -207,7 +215,9 @@ static u32 HandleConditionSearchInput(struct Pokenav_SearchResults *menu) return CONDITION_SEARCH_FUNC_SELECT_MON; } else + { return CONDITION_SEARCH_FUNC_NONE; + } } static u32 ReturnToConditionSearchList(struct Pokenav_SearchResults *menu) diff --git a/src/pokenav_menu_handler_gfx.c b/src/pokenav_menu_handler_gfx.c index ede88affdbee..e223b7caba31 100644 --- a/src/pokenav_menu_handler_gfx.c +++ b/src/pokenav_menu_handler_gfx.c @@ -505,7 +505,9 @@ static u32 LoopedTask_OpenMenu(s32 state) ShowBg(2); ShowBg(3); if (gfx->pokenavAlreadyOpen) + { PokenavFadeScreen(POKENAV_FADE_FROM_BLACK); + } else { PlaySE(SE_POKENAV_ON); diff --git a/src/slot_machine.c b/src/slot_machine.c index 34c7ef8849f2..217767fc9e98 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -2324,7 +2324,9 @@ static bool8 ReelTask_MoveToStop(struct Task *task) memcpy(reelStopShocks, sReelStopShocks, sizeof(sReelStopShocks)); reelPixelPos = sSlotMachine->reelPixelOffsets[task->tReelId] % REEL_SYMBOL_HEIGHT; if (reelPixelPos != 0) + { reelPixelPos = AdvanceSlotReelToNextSymbol(task->tReelId, sSlotMachine->reelSpeed); + } else if (sSlotMachine->reelExtraTurns[task->tReelId]) { sSlotMachine->reelExtraTurns[task->tReelId]--; diff --git a/src/sprite.c b/src/sprite.c index 0736269be0a3..d11277400ff2 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -1090,9 +1090,13 @@ void ContinueAffineAnim(struct Sprite *sprite) u8 matrixNum = GetSpriteMatrixNum(sprite); if (sAffineAnimStates[matrixNum].delayCounter) + { AffineAnimDelay(matrixNum, sprite); + } else if (sprite->affineAnimPaused) + { return; + } else { s16 type; diff --git a/src/tv.c b/src/tv.c index 9ab9fc8969a4..26d568642f99 100644 --- a/src/tv.c +++ b/src/tv.c @@ -5364,7 +5364,8 @@ static void DoTVShow3CheersForPokeblocks(void) if (show->threeCheers.sheen > 24) { StringCopy(gStringVar2, gText_Excellent); - } else if (show->threeCheers.sheen > 22) + } + else if (show->threeCheers.sheen > 22) { StringCopy(gStringVar2, gText_VeryGood); }