From baf5be20354c9dfde182c0a2dd23ab40643fe57b Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Fri, 9 May 2025 17:33:23 +0200 Subject: [PATCH] Replace: moveId -> move, moveIdx -> moveIndex (#2134) --- include/battle_gfx_sfx_util.h | 2 +- include/battle_tv.h | 2 +- include/global.h | 2 +- include/party_menu.h | 2 +- include/pokemon_storage_system.h | 2 +- include/tv.h | 2 +- src/apprentice.c | 40 +++++++++++------------ src/battle_controller_recorded_opponent.c | 4 +-- src/battle_controller_recorded_player.c | 4 +-- src/battle_dome.c | 38 ++++++++++----------- src/battle_gfx_sfx_util.c | 2 +- src/battle_script_commands.c | 12 +++---- src/battle_tower.c | 2 +- src/battle_transition.c | 24 +++++++------- src/battle_tv.c | 38 ++++++++++----------- src/contest_ai.c | 6 ++-- src/item_menu.c | 16 ++++----- src/move_relearner.c | 12 +++---- src/pokemon.c | 28 ++++++++-------- src/pokemon_storage_system.c | 4 +-- src/scrcmd.c | 8 ++--- src/secret_base.c | 10 +++--- src/tv.c | 6 ++-- 23 files changed, 133 insertions(+), 133 deletions(-) diff --git a/include/battle_gfx_sfx_util.h b/include/battle_gfx_sfx_util.h index f9ce1bb2ca..e65df4bf2a 100644 --- a/include/battle_gfx_sfx_util.h +++ b/include/battle_gfx_sfx_util.h @@ -9,7 +9,7 @@ void SpriteCB_TrainerSlideIn(struct Sprite *sprite); void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status); bool8 TryHandleLaunchBattleTableAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId, u16 argument); void InitAndLaunchSpecialAnimation(u8 activeBattlerId, u8 attacker, u8 target, u8 tableId); -bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn); +bool8 IsMoveWithoutAnimation(u16 move, u8 animationTurn); bool8 IsBattleSEPlaying(u8 battler); void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battler); void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battler); diff --git a/include/battle_tv.h b/include/battle_tv.h index b2a89451a1..5766907637 100644 --- a/include/battle_tv.h +++ b/include/battle_tv.h @@ -6,6 +6,6 @@ void BattleTv_SetDataBasedOnMove(u16 move, u16 weatherFlags, struct DisableStruc void BattleTv_SetDataBasedOnAnimation(u8 animationId); void TryPutLinkBattleTvShowOnAir(void); void BattleTv_ClearExplosionFaintCause(void); -u8 GetBattlerMoveSlotId(u8 battler, u16 moveId); +u8 GetBattlerMoveSlotId(u8 battler, u16 move); #endif // GUARD_BATTLE_TV_H diff --git a/include/global.h b/include/global.h index 62da1165c7..36ddbffbf2 100644 --- a/include/global.h +++ b/include/global.h @@ -459,7 +459,7 @@ struct ApprenticeQuestion u8 moveSlot:2; u8 suggestedChange:2; // TRUE if told to use held item or second move, FALSE if told to use no item or first move //u8 padding; - u16 data; // used both as an itemId and a moveId + u16 data; // used both as an itemId and a move }; struct PlayersApprentice diff --git a/include/party_menu.h b/include/party_menu.h index 2d33b3b9fc..15ab57b0a9 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -16,7 +16,7 @@ struct PartyMenu s8 slotId2; u8 action; u16 bagItem; - s16 data1; // used variously as a moveId, counter, moveSlotId, or cursorPos + s16 data1; // used variously as a move, counter, moveSlotId, or cursorPos s16 learnMoveState; // data2, used only as a learn move state }; diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index eb25c0ff27..b4f0d6565e 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -57,7 +57,7 @@ bool8 CheckFreePokemonStorageSpace(void); bool32 CheckBoxMonSanityAt(u32 boxId, u32 boxPosition); u32 CountStorageNonEggMons(void); u32 CountAllStorageMons(void); -bool32 AnyStorageMonWithMove(u16 moveId); +bool32 AnyStorageMonWithMove(u16 move); void ResetWaldaWallpaper(void); void SetWaldaWallpaperLockedOrUnlocked(bool32 unlocked); diff --git a/include/tv.h b/include/tv.h index 31c8fcc50f..f47aa532d7 100644 --- a/include/tv.h +++ b/include/tv.h @@ -5,7 +5,7 @@ extern u8 *const gTVStringVarPtrs[3]; void ClearTVShowData(void); void TryPutBreakingNewsOnAir(void); -void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove); +void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIndex, const u16 *movePtr, u16 betterMove); void TryPutFrontierTVShowOnAir(u16 winStreak, u8 facility); void DoTVShow(void); void DoTVShowInSearchOfTrainers(void); diff --git a/src/apprentice.c b/src/apprentice.c index 72ab8f24c8..7e41ad8f40 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -70,8 +70,8 @@ struct ApprenticeQuestionData { u16 speciesId; u16 altSpeciesId; - u16 moveId1; - u16 moveId2; + u16 move1; + u16 move2; }; // IWRAM common @@ -81,7 +81,7 @@ COMMON_DATA void (*gApprenticeFunc)(void) = NULL; // This file's functions. static u16 GetRandomAlternateMove(u8 monId); -static bool8 TrySetMove(u8 monId, u16 moveId); +static bool8 TrySetMove(u8 monId, u16 move); static void CreateChooseAnswerTask(bool8 noBButton, u8 itemsCount, u8 windowId); static u8 CreateAndShowWindow(u8 left, u8 top, u8 width, u8 height); static void RemoveAndHideWindow(u8 windowId); @@ -337,7 +337,7 @@ static u16 GetRandomAlternateMove(u8 monId) u16 species; const u16 *learnset; bool32 needTMs = FALSE; - u16 moveId = MOVE_NONE; + u16 move = MOVE_NONE; bool32 shouldUseMove; u8 level; @@ -379,7 +379,7 @@ static u16 GetRandomAlternateMove(u8 monId) } while (!shouldUseMove); - moveId = ItemIdToBattleMoveId(ITEM_TM01 + id); + move = ItemIdToBattleMoveId(ITEM_TM01 + id); shouldUseMove = TRUE; if (numLearnsetMoves <= MAX_MON_MOVES) @@ -390,7 +390,7 @@ static u16 GetRandomAlternateMove(u8 monId) for (; j < numLearnsetMoves; j++) { // Keep looking for TMs until one not in the level up learnset is found - if ((learnset[j] & LEVEL_UP_MOVE_ID) == moveId) + if ((learnset[j] & LEVEL_UP_MOVE_ID) == move) { shouldUseMove = FALSE; break; @@ -414,13 +414,13 @@ static u16 GetRandomAlternateMove(u8 monId) { // Get a random move excluding the 4 it would know at max level u8 learnsetId = Random() % (numLearnsetMoves - MAX_MON_MOVES); - moveId = learnset[learnsetId] & LEVEL_UP_MOVE_ID; + move = learnset[learnsetId] & LEVEL_UP_MOVE_ID; shouldUseMove = TRUE; for (j = numLearnsetMoves - MAX_MON_MOVES; j < numLearnsetMoves; j++) { // Keep looking for moves until one not in the last 4 is found - if ((learnset[j] & LEVEL_UP_MOVE_ID) == moveId) + if ((learnset[j] & LEVEL_UP_MOVE_ID) == move) { shouldUseMove = FALSE; break; @@ -430,29 +430,29 @@ static u16 GetRandomAlternateMove(u8 monId) } } - if (TrySetMove(monId, moveId)) + if (TrySetMove(monId, move)) { - if (sValidApprenticeMoves[moveId]) + if (sValidApprenticeMoves[move]) break; i++; } } gApprenticePartyMovesData->moveCounter++; - return moveId; + return move; } -static bool8 TrySetMove(u8 monId, u16 moveId) +static bool8 TrySetMove(u8 monId, u16 move) { u8 i; for (i = 0; i < NUM_WHICH_MOVE_QUESTIONS; i++) { - if (gApprenticePartyMovesData->moves[monId][i] == moveId) + if (gApprenticePartyMovesData->moves[monId][i] == move) return FALSE; } - gApprenticePartyMovesData->moves[monId][gApprenticePartyMovesData->moveCounter] = moveId; + gApprenticePartyMovesData->moves[monId][gApprenticePartyMovesData->moveCounter] = move; return TRUE; } @@ -605,8 +605,8 @@ static void CreateApprenticeMenu(u8 menu) case APPRENTICE_ASK_MOVES: left = 17; top = 8; - strings[0] = gMoveNames[gApprenticeQuestionData->moveId1]; - strings[1] = gMoveNames[gApprenticeQuestionData->moveId2]; + strings[0] = gMoveNames[gApprenticeQuestionData->move1]; + strings[1] = gMoveNames[gApprenticeQuestionData->move2]; break; case APPRENTICE_ASK_GIVE: left = 18; @@ -1006,8 +1006,8 @@ static void InitQuestionData(void) count = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].monId; APPRENTICE_SPECIES_ID_NO_COND(id1, count); gApprenticeQuestionData->speciesId = gApprentices[PLAYER_APPRENTICE.id].species[id1]; - gApprenticeQuestionData->moveId1 = GetDefaultMove(count, id1, PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].moveSlot); - gApprenticeQuestionData->moveId2 = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data; + gApprenticeQuestionData->move1 = GetDefaultMove(count, id1, PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].moveSlot); + gApprenticeQuestionData->move2 = PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data; } } else if (gSpecialVar_0x8005 == APPRENTICE_QUESTION_WHAT_ITEM) @@ -1062,10 +1062,10 @@ static void ApprenticeBufferString(void) StringCopy(stringDst, gSpeciesNames[gApprenticeQuestionData->speciesId]); break; case APPRENTICE_BUFF_MOVE1: - StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->moveId1]); + StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->move1]); break; case APPRENTICE_BUFF_MOVE2: - StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->moveId2]); + StringCopy(stringDst, gMoveNames[gApprenticeQuestionData->move2]); break; case APPRENTICE_BUFF_ITEM: StringCopy(stringDst, ItemId_GetName(PLAYER_APPRENTICE.questions[CURRENT_QUESTION_NUM].data)); diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 8178e51d01..518086cbb7 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1419,9 +1419,9 @@ static void RecordedOpponentHandleChooseMove(void) } else { - u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler); + u8 moveIndex = RecordedBattle_GetBattlerAction(gActiveBattler); u8 target = RecordedBattle_GetBattlerAction(gActiveBattler); - BtlController_EmitTwoReturnValues(B_COMM_TO_ENGINE, 10, moveId | (target << 8)); + BtlController_EmitTwoReturnValues(B_COMM_TO_ENGINE, 10, moveIndex | (target << 8)); } RecordedOpponentBufferExecCompleted(); diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index f11a759148..6b061487b4 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -1445,9 +1445,9 @@ static void RecordedPlayerHandleChooseMove(void) } else { - u8 moveId = RecordedBattle_GetBattlerAction(gActiveBattler); + u8 moveIndex = RecordedBattle_GetBattlerAction(gActiveBattler); u8 target = RecordedBattle_GetBattlerAction(gActiveBattler); - BtlController_EmitTwoReturnValues(B_COMM_TO_ENGINE, 10, moveId | (target << 8)); + BtlController_EmitTwoReturnValues(B_COMM_TO_ENGINE, 10, moveIndex | (target << 8)); } RecordedPlayerBufferExecCompleted(); diff --git a/src/battle_dome.c b/src/battle_dome.c index 68cae14a6e..9573f67cc7 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -2678,24 +2678,24 @@ int GetDomeTrainerSelectedMons(u16 tournamentTrainerId) static int SelectOpponentMons_Good(u16 tournamentTrainerId, bool8 allowRandom) { - int i, moveId, playerMonId; + int i, moveIndex, playerMonId; int partyMovePoints[FRONTIER_PARTY_SIZE]; for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { partyMovePoints[i] = 0; - for (moveId = 0; moveId < MAX_MON_MOVES; moveId++) + for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) { for (playerMonId = 0; playerMonId < FRONTIER_PARTY_SIZE; playerMonId++) { if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN) { - partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId), + partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveIndex), GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD); } else { - partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveId], + partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveIndex], GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD); } } @@ -2707,24 +2707,24 @@ static int SelectOpponentMons_Good(u16 tournamentTrainerId, bool8 allowRandom) // Identical to function above, but uses EFFECTIVENESS_MODE_BAD static int SelectOpponentMons_Bad(u16 tournamentTrainerId, bool8 allowRandom) { - int i, moveId, playerMonId; + int i, moveIndex, playerMonId; int partyMovePoints[FRONTIER_PARTY_SIZE]; for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { partyMovePoints[i] = 0; - for (moveId = 0; moveId < MAX_MON_MOVES; moveId++) + for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) { for (playerMonId = 0; playerMonId < FRONTIER_PARTY_SIZE; playerMonId++) { if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN) { - partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId), + partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveIndex), GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD); } else { - partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveId], + partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveIndex], GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD); } } @@ -5222,7 +5222,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun { int i, j, k; int moveScores[MAX_MON_MOVES * FRONTIER_PARTY_SIZE]; - u16 moveIds[MAX_MON_MOVES * FRONTIER_PARTY_SIZE]; + u16 moves[MAX_MON_MOVES * FRONTIER_PARTY_SIZE]; u16 bestScore = 0; u16 bestId = 0; int movePower = 0; @@ -5236,17 +5236,17 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun // TODO: Clean this up, looks like a different data structure (2D array) moveScores[i * MAX_MON_MOVES + j] = 0; if (DOME_TRAINERS[winnerTournamentId].trainerId == TRAINER_FRONTIER_BRAIN) - moveIds[i * MAX_MON_MOVES + j] = GetFrontierBrainMonMove(i, j); + moves[i * MAX_MON_MOVES + j] = GetFrontierBrainMonMove(i, j); else - moveIds[i * MAX_MON_MOVES + j] = gFacilityTrainerMons[DOME_MONS[winnerTournamentId][i]].moves[j]; + moves[i * MAX_MON_MOVES + j] = gFacilityTrainerMons[DOME_MONS[winnerTournamentId][i]].moves[j]; - movePower = gBattleMoves[moveIds[i * MAX_MON_MOVES + j]].power; + movePower = gBattleMoves[moves[i * MAX_MON_MOVES + j]].power; if (movePower == 0) movePower = 40; else if (movePower == 1) movePower = 60; - else if (moveIds[i * MAX_MON_MOVES + j] == MOVE_SELF_DESTRUCT - || moveIds[i * MAX_MON_MOVES + j] == MOVE_EXPLOSION) + else if (moves[i * MAX_MON_MOVES + j] == MOVE_SELF_DESTRUCT + || moves[i * MAX_MON_MOVES + j] == MOVE_EXPLOSION) movePower /= 2; for (k = 0; k < FRONTIER_PARTY_SIZE; k++) @@ -5265,7 +5265,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun else targetAbility = gSpeciesInfo[targetSpecies].abilities[0]; - var = AI_TypeCalc(moveIds[i * MAX_MON_MOVES + j], targetSpecies, targetAbility); + var = AI_TypeCalc(moves[i * MAX_MON_MOVES + j], targetSpecies, targetAbility); if (var & MOVE_RESULT_NOT_VERY_EFFECTIVE && var & MOVE_RESULT_SUPER_EFFECTIVE) moveScores[i * MAX_MON_MOVES + j] += movePower; else if (var & MOVE_RESULT_NO_EFFECT) @@ -5285,7 +5285,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun } else if (bestScore == moveScores[i * MAX_MON_MOVES + j]) { - if (moveIds[bestId] < moveIds[i * MAX_MON_MOVES + j]) // Why not use (Random() & 1) instead of promoting moves with a higher id? + if (moves[bestId] < moves[i * MAX_MON_MOVES + j]) // Why not use (Random() & 1) instead of promoting moves with a higher id? bestId = i * MAX_MON_MOVES + j; } } @@ -5296,7 +5296,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun { for (i = 0; i < roundId - 1; i++) { - if (gSaveBlock2Ptr->frontier.domeWinningMoves[GetOpposingNPCTournamentIdByRound(winnerTournamentId, i)] == moveIds[j]) + if (gSaveBlock2Ptr->frontier.domeWinningMoves[GetOpposingNPCTournamentIdByRound(winnerTournamentId, i)] == moves[j]) break; } if (i != roundId - 1) @@ -5316,7 +5316,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun j = k; bestScore = moveScores[k]; } - else if (bestScore == moveScores[k] && moveIds[j] < moveIds[k]) // Yes, these conditions are redundant + else if (bestScore == moveScores[k] && moves[j] < moves[k]) // Yes, these conditions are redundant { j = k; bestScore = moveScores[k]; @@ -5328,7 +5328,7 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun if (moveScores[j] == 0) j = bestId; - return moveIds[j]; + return moves[j]; } static void Task_ShowTourneyTree(u8 taskId) diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 9181b82667..56906804c8 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -545,7 +545,7 @@ static void Task_ClearBitWhenSpecialAnimDone(u8 taskId) #undef tBattlerId // Great function to include newly added moves that don't have animation yet. -bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn) +bool8 IsMoveWithoutAnimation(u16 move, u8 animationTurn) { return FALSE; } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 0f99173b11..a79851acc0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5464,8 +5464,8 @@ static void Cmd_yesnoboxlearnmove(void) } else { - u16 moveId = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MOVE1 + movePosition); - if (IsHMMove2(moveId)) + u16 move = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_MOVE1 + movePosition); + if (IsHMMove2(move)) { PrepareStringBattle(STRINGID_HMMOVESCANTBEFORGOTTEN, gActiveBattler); gBattleScripting.learnMoveState = 6; @@ -5474,7 +5474,7 @@ static void Cmd_yesnoboxlearnmove(void) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - PREPARE_MOVE_BUFFER(gBattleTextBuff2, moveId) + PREPARE_MOVE_BUFFER(gBattleTextBuff2, move) RemoveMonPPBonus(&gPlayerParty[gBattleStruct->expGetterMonId], movePosition); SetMonMoveSlot(&gPlayerParty[gBattleStruct->expGetterMonId], gMoveToLearn, movePosition); @@ -9508,7 +9508,7 @@ static void Cmd_assistattackselect(void) { s32 chooseableMovesNo = 0; struct Pokemon *party; - s32 monId, moveId; + s32 monId, moveIndex; u16 *validMoves = gBattleStruct->assistPossibleMoves; if (GET_BATTLER_SIDE(gBattlerAttacker) != B_SIDE_PLAYER) @@ -9525,10 +9525,10 @@ static void Cmd_assistattackselect(void) if (GetMonData(&party[monId], MON_DATA_SPECIES_OR_EGG) == SPECIES_EGG) continue; - for (moveId = 0; moveId < MAX_MON_MOVES; moveId++) + for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) { s32 i = 0; - u16 move = GetMonData(&party[monId], MON_DATA_MOVE1 + moveId); + u16 move = GetMonData(&party[monId], MON_DATA_MOVE1 + moveIndex); if (IsInvalidForSleepTalkOrAssist(move)) continue; diff --git a/src/battle_tower.c b/src/battle_tower.c index 0420a15f63..0190d3c922 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -2417,7 +2417,7 @@ static void LoadMultiPartnerCandidatesData(void) static void GetPotentialPartnerMoveAndSpecies(u16 trainerId, u16 monId) { - u16 move = 0; + u16 move = MOVE_NONE; u16 species = 0; SetFacilityPtrsGetLevel(); diff --git a/src/battle_transition.c b/src/battle_transition.c index c23578e608..174602471b 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -79,7 +79,7 @@ struct RectangularSpiralLine { u8 state; s16 position; - u8 moveIdx; + u8 moveIndex; s16 reboundPosition; bool8 outward; }; @@ -3204,28 +3204,28 @@ static bool8 RectangularSpiral_Init(struct Task *task) // Line starting in top left sRectangularSpiralLines[0].state = SPIRAL_INWARD_START; sRectangularSpiralLines[0].position = -1; - sRectangularSpiralLines[0].moveIdx = 1; + sRectangularSpiralLines[0].moveIndex = 1; sRectangularSpiralLines[0].reboundPosition = 308; sRectangularSpiralLines[0].outward = FALSE; // Line starting in bottom right sRectangularSpiralLines[1].state = SPIRAL_INWARD_START; sRectangularSpiralLines[1].position = -1; - sRectangularSpiralLines[1].moveIdx = 1; + sRectangularSpiralLines[1].moveIndex = 1; sRectangularSpiralLines[1].reboundPosition = 308; sRectangularSpiralLines[1].outward = FALSE; // Line starting in top right sRectangularSpiralLines[2].state = SPIRAL_INWARD_START; sRectangularSpiralLines[2].position = -3; - sRectangularSpiralLines[2].moveIdx = 1; + sRectangularSpiralLines[2].moveIndex = 1; sRectangularSpiralLines[2].reboundPosition = 307; sRectangularSpiralLines[2].outward = FALSE; // Line starting in bottom left sRectangularSpiralLines[3].state = SPIRAL_INWARD_START; sRectangularSpiralLines[3].position = -3; - sRectangularSpiralLines[3].moveIdx = 1; + sRectangularSpiralLines[3].moveIndex = 1; sRectangularSpiralLines[3].reboundPosition = 307; sRectangularSpiralLines[3].outward = FALSE; @@ -3288,7 +3288,7 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru // Has spiral finished? // Note that most move data arrays endsin SPIRAL_END but it is // only ever reached on the final array of spiraling outward. - if (moveData[line->moveIdx] == SPIRAL_END) + if (moveData[line->moveIndex] == SPIRAL_END) return FALSE; // Presumably saving data for debug. @@ -3319,21 +3319,21 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru // Below check is never true. // SPIRAL_END was already checked, and position is never >= 640 - if (line->position >= 640 || moveData[line->moveIdx] == SPIRAL_END) + if (line->position >= 640 || moveData[line->moveIndex] == SPIRAL_END) return FALSE; - if (!line->outward && moveData[line->moveIdx] == SPIRAL_REBOUND) + if (!line->outward && moveData[line->moveIndex] == SPIRAL_REBOUND) { // Line has reached the final point of spiraling inward. // Time to flip and start spiraling outward. line->outward = TRUE; - line->moveIdx = 1; + line->moveIndex = 1; line->position = line->reboundPosition; line->state = SPIRAL_OUTWARD_START; } // Reached move target, advance to next movement. - if (line->position == moveData[line->moveIdx]) + if (line->position == moveData[line->moveIndex]) { line->state++; if (line->outward == TRUE) @@ -3343,7 +3343,7 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru // Still spiraling outward, loop back to the first state // but use the second set of move targets. // For example, the 28 in sRectangularSpiral_Major_OutwardUp - line->moveIdx++; + line->moveIndex++; line->state = SPIRAL_OUTWARD_START; } } @@ -3354,7 +3354,7 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru // Still spiraling inward, loop back to the first state // but use the second set of move targets. // For example, the 275 in sRectangularSpiral_Major_InwardRight - line->moveIdx++; + line->moveIndex++; line->state = SPIRAL_INWARD_START; } } diff --git a/src/battle_tv.c b/src/battle_tv.c index 33c720cc13..bf31f18f47 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -15,8 +15,8 @@ static bool8 IsNotSpecialBattleString(u16 stringId); static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3); static void TrySetBattleSeminarShow(void); static void AddPointsOnFainting(bool8 targetFainted); -static void AddPointsBasedOnWeather(u16 weatherFlags, u16 moveId, u8 moveSlot); -static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride); +static void AddPointsBasedOnWeather(u16 weatherFlags, u16 move, u8 moveSlot); +static bool8 ShouldCalculateDamage(u16 move, s32 *dmg, u16 *powerOverride); #define TABLE_END ((u16)-1) @@ -1056,7 +1056,7 @@ void TryPutLinkBattleTvShowOnAir(void) u8 countPlayer = 0, countOpponent = 0; s16 sum = 0; u16 species = 0; - u16 moveId = 0; + u16 move = MOVE_NONE; s32 i, j; int zero = 0, one = 1; //needed for matching @@ -1124,8 +1124,8 @@ void TryPutLinkBattleTvShowOnAir(void) } } - moveId = GetMonData(&gPlayerParty[playerBestMonId], MON_DATA_MOVE1 + i, NULL); - if (playerBestSum == 0 || moveId == 0) + move = GetMonData(&gPlayerParty[playerBestMonId], MON_DATA_MOVE1 + i, NULL); + if (playerBestSum == 0 || move == MOVE_NONE) return; if (gBattleTypeFlags & BATTLE_TYPE_MULTI) @@ -1134,12 +1134,12 @@ void TryPutLinkBattleTvShowOnAir(void) || (playerBestMonId >= MULTI_PARTY_SIZE && GetLinkTrainerFlankId(gBattleScripting.multiplayerId))) { j = (opponentBestMonId < MULTI_PARTY_SIZE) ? FALSE : TRUE; - PutBattleUpdateOnTheAir(GetOpposingLinkMultiBattlerId(j, gBattleScripting.multiplayerId), moveId, playerBestSpecies, opponentBestSpecies); + PutBattleUpdateOnTheAir(GetOpposingLinkMultiBattlerId(j, gBattleScripting.multiplayerId), move, playerBestSpecies, opponentBestSpecies); } } else { - PutBattleUpdateOnTheAir(gBattleScripting.multiplayerId ^ 1, moveId, playerBestSpecies, opponentBestSpecies); + PutBattleUpdateOnTheAir(gBattleScripting.multiplayerId ^ 1, move, playerBestSpecies, opponentBestSpecies); } } @@ -1505,9 +1505,9 @@ static void TrySetBattleSeminarShow(void) gCurrentMove = currMoveSaved; } -static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride) +static bool8 ShouldCalculateDamage(u16 move, s32 *dmg, u16 *powerOverride) { - if (gBattleMoves[moveId].power == 0) + if (gBattleMoves[move].power == 0) { *dmg = 0; return FALSE; @@ -1517,7 +1517,7 @@ static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride) s32 i = 0; do { - if (moveId == sVariableDmgMoves[i]) + if (move == sVariableDmgMoves[i]) break; i++; } while (sVariableDmgMoves[i] != TABLE_END); @@ -1527,13 +1527,13 @@ static bool8 ShouldCalculateDamage(u16 moveId, s32 *dmg, u16 *powerOverride) *dmg = 0; return FALSE; } - else if (moveId == MOVE_PSYWAVE) + else if (move == MOVE_PSYWAVE) { *dmg = gBattleMons[gBattlerAttacker].level; *dmg /= 2; return FALSE; } - else if (moveId == MOVE_MAGNITUDE) + else if (move == MOVE_MAGNITUDE) { *powerOverride = 10; return TRUE; @@ -1568,7 +1568,7 @@ void BattleTv_ClearExplosionFaintCause(void) } } -u8 GetBattlerMoveSlotId(u8 battler, u16 moveId) +u8 GetBattlerMoveSlotId(u8 battler, u16 move) { s32 i; struct Pokemon *party; @@ -1583,7 +1583,7 @@ u8 GetBattlerMoveSlotId(u8 battler, u16 moveId) { if (i >= MAX_MON_MOVES) break; - if (GetMonData(&party[gBattlerPartyIndexes[battler]], MON_DATA_MOVE1 + i, NULL) == moveId) + if (GetMonData(&party[gBattlerPartyIndexes[battler]], MON_DATA_MOVE1 + i, NULL) == move) break; i++; } @@ -1591,14 +1591,14 @@ u8 GetBattlerMoveSlotId(u8 battler, u16 moveId) return i; } -static void AddPointsBasedOnWeather(u16 weatherFlags, u16 moveId, u8 moveSlot) +static void AddPointsBasedOnWeather(u16 weatherFlags, u16 move, u8 moveSlot) { if (weatherFlags & B_WEATHER_RAIN) - AddMovePoints(PTS_RAIN, moveId, moveSlot, 0); + AddMovePoints(PTS_RAIN, move, moveSlot, 0); else if (weatherFlags & B_WEATHER_SUN) - AddMovePoints(PTS_SUN, moveId, moveSlot, 0); + AddMovePoints(PTS_SUN, move, moveSlot, 0); else if (weatherFlags & B_WEATHER_SANDSTORM) - AddMovePoints(PTS_SANDSTORM, moveId, moveSlot, 0); + AddMovePoints(PTS_SANDSTORM, move, moveSlot, 0); else if (weatherFlags & B_WEATHER_HAIL) - AddMovePoints(PTS_HAIL, moveId, moveSlot, 0); + AddMovePoints(PTS_HAIL, move, moveSlot, 0); } diff --git a/src/contest_ai.c b/src/contest_ai.c index a4bb5b4549..443e57f8be 100644 --- a/src/contest_ai.c +++ b/src/contest_ai.c @@ -326,8 +326,8 @@ u8 ContestAI_GetActionToUse(void) { // Randomly choose a move index. If it's the move // with the highest (or tied highest) score, return - u8 moveIdx = MOD(Random(), MAX_MON_MOVES); - u8 score = eContestAI.moveScores[moveIdx]; + u8 moveIndex = MOD(Random(), MAX_MON_MOVES); + u8 score = eContestAI.moveScores[moveIndex]; int i; for (i = 0; i < MAX_MON_MOVES; i++) { @@ -335,7 +335,7 @@ u8 ContestAI_GetActionToUse(void) break; } if (i == MAX_MON_MOVES) - return moveIdx; + return moveIndex; } } diff --git a/src/item_menu.c b/src/item_menu.c index f0abfcf62a..6d52e4be1c 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2549,7 +2549,7 @@ static void PrepareTMHMMoveWindow(void) static void PrintTMHMMoveData(u16 itemId) { u8 i; - u16 moveId; + u16 move; const u8 *text; FillWindowPixelBuffer(WIN_TMHM_INFO, PIXEL_FILL(0)); @@ -2561,35 +2561,35 @@ static void PrintTMHMMoveData(u16 itemId) } else { - moveId = ItemIdToBattleMoveId(itemId); - BlitMenuInfoIcon(WIN_TMHM_INFO, gBattleMoves[moveId].type + 1, 0, 0); + move = ItemIdToBattleMoveId(itemId); + BlitMenuInfoIcon(WIN_TMHM_INFO, gBattleMoves[move].type + 1, 0, 0); // Print TMHM power - if (gBattleMoves[moveId].power <= 1) + if (gBattleMoves[move].power <= 1) { text = gText_ThreeDashes; } else { - ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].power, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].power, STR_CONV_MODE_RIGHT_ALIGN, 3); text = gStringVar1; } BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 12, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); // Print TMHM accuracy - if (gBattleMoves[moveId].accuracy == 0) + if (gBattleMoves[move].accuracy == 0) { text = gText_ThreeDashes; } else { - ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].accuracy, STR_CONV_MODE_RIGHT_ALIGN, 3); text = gStringVar1; } BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, text, 7, 24, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); // Print TMHM pp - ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].pp, STR_CONV_MODE_RIGHT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].pp, STR_CONV_MODE_RIGHT_ALIGN, 3); BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, gStringVar1, 7, 36, 0, 0, TEXT_SKIP_DRAW, COLORID_TMHM_INFO); CopyWindowToVram(WIN_TMHM_INFO, COPYWIN_GFX); diff --git a/src/move_relearner.c b/src/move_relearner.c index 975663e4d3..19da0cb0fb 100644 --- a/src/move_relearner.c +++ b/src/move_relearner.c @@ -705,9 +705,9 @@ static void DoMoveRelearnerMain(void) } else { - u16 moveId = GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_MOVE1 + sMoveRelearnerStruct->moveSlot); + u16 move = GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_MOVE1 + sMoveRelearnerStruct->moveSlot); - StringCopy(gStringVar3, gMoveNames[moveId]); + StringCopy(gStringVar3, gMoveNames[move]); RemoveMonPPBonus(&gPlayerParty[sMoveRelearnerStruct->partyMon], sMoveRelearnerStruct->moveSlot); SetMonMoveSlot(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove(), sMoveRelearnerStruct->moveSlot); StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]); @@ -916,19 +916,19 @@ static void CreateLearnableMovesList(void) sMoveRelearnerStruct->numToShowAtOnce = LoadMoveRelearnerMovesList(sMoveRelearnerStruct->menuItems, sMoveRelearnerStruct->numMenuChoices); } -void MoveRelearnerShowHideHearts(s32 moveId) +void MoveRelearnerShowHideHearts(s32 move) { u16 numHearts; u16 i; - if (!sMoveRelearnerMenuSate.showContestInfo || moveId == LIST_CANCEL) + if (!sMoveRelearnerMenuSate.showContestInfo || move == LIST_CANCEL) { for (i = 0; i < 16; i++) gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = TRUE; } else { - numHearts = (u8)(gContestEffects[gContestMoves[moveId].effect].appeal / 10); + numHearts = (u8)(gContestEffects[gContestMoves[move].effect].appeal / 10); if (numHearts == 0xFF) numHearts = 0; @@ -942,7 +942,7 @@ void MoveRelearnerShowHideHearts(s32 moveId) gSprites[sMoveRelearnerStruct->heartSpriteIds[i]].invisible = FALSE; } - numHearts = (u8)(gContestEffects[gContestMoves[moveId].effect].jam / 10); + numHearts = (u8)(gContestEffects[gContestMoves[move].effect].jam / 10); if (numHearts == 0xFF) numHearts = 0; diff --git a/src/pokemon.c b/src/pokemon.c index 310d686e69..d0b6c3302e 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5095,17 +5095,17 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov // Heal PP for all moves for (temp2 = 0; (signed)(temp2) < (signed)(MAX_MON_MOVES); temp2++) { - u16 moveId; + u16 move; dataUnsigned = GetMonData(mon, MON_DATA_PP1 + temp2, NULL); - moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); - if (dataUnsigned != CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2)) + move = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); + if (dataUnsigned != CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2)) { dataUnsigned += itemEffect[itemEffectParam]; - moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant - if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2)) + move = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant + if (dataUnsigned > CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2)) { - moveId = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant - dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2); + move = GetMonData(mon, MON_DATA_MOVE1 + temp2, NULL); // Redundant + dataUnsigned = CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), temp2); } SetMonData(mon, MON_DATA_PP1 + temp2, &dataUnsigned); @@ -5121,17 +5121,17 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov else { // Heal PP for one move - u16 moveId; + u16 move; dataUnsigned = GetMonData(mon, MON_DATA_PP1 + moveIndex, NULL); - moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); - if (dataUnsigned != CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex)) + move = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); + if (dataUnsigned != CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex)) { dataUnsigned += itemEffect[itemEffectParam++]; - moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant - if (dataUnsigned > CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex)) + move = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant + if (dataUnsigned > CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex)) { - moveId = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant - dataUnsigned = CalculatePPWithBonus(moveId, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex); + move = GetMonData(mon, MON_DATA_MOVE1 + moveIndex, NULL); // Redundant + dataUnsigned = CalculatePPWithBonus(move, GetMonData(mon, MON_DATA_PP_BONUSES, NULL), moveIndex); } SetMonData(mon, MON_DATA_PP1 + moveIndex, &dataUnsigned); diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index b9caa364b1..6a24f24945 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -9633,9 +9633,9 @@ u32 CountAllStorageMons(void) return count; } -bool32 AnyStorageMonWithMove(u16 moveId) +bool32 AnyStorageMonWithMove(u16 move) { - u16 moves[] = {moveId, MOVES_COUNT}; + u16 moves[] = {move, MOVES_COUNT}; s32 i, j; for (i = 0; i < TOTAL_BOXES_COUNT; i++) diff --git a/src/scrcmd.c b/src/scrcmd.c index 218be539f5..916cea02d1 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1607,9 +1607,9 @@ bool8 ScrCmd_bufferdecorationname(struct ScriptContext *ctx) bool8 ScrCmd_buffermovename(struct ScriptContext *ctx) { u8 stringVarIndex = ScriptReadByte(ctx); - u16 moveId = VarGet(ScriptReadHalfword(ctx)); + u16 move = VarGet(ScriptReadHalfword(ctx)); - StringCopy(sScriptStringVars[stringVarIndex], gMoveNames[moveId]); + StringCopy(sScriptStringVars[stringVarIndex], gMoveNames[move]); return FALSE; } @@ -1712,7 +1712,7 @@ bool8 ScrCmd_setmonmove(struct ScriptContext *ctx) bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx) { u8 i; - u16 moveId = ScriptReadHalfword(ctx); + u16 move = ScriptReadHalfword(ctx); gSpecialVar_Result = PARTY_SIZE; for (i = 0; i < PARTY_SIZE; i++) @@ -1720,7 +1720,7 @@ bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx) u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL); if (!species) break; - if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG) && MonKnowsMove(&gPlayerParty[i], moveId) == TRUE) + if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG) && MonKnowsMove(&gPlayerParty[i], move) == TRUE) { gSpecialVar_Result = i; gSpecialVar_0x8004 = species; diff --git a/src/secret_base.c b/src/secret_base.c index 9509cd0fc5..7d4975e388 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -771,7 +771,7 @@ static u8 GetAverageEVs(struct Pokemon *pokemon) void SetPlayerSecretBaseParty(void) { u16 i; - u16 moveIdx; + u16 moveIndex; u16 partyId; struct SecretBaseParty *party; @@ -781,8 +781,8 @@ void SetPlayerSecretBaseParty(void) { for (i = 0; i < PARTY_SIZE; i++) { - for (moveIdx = 0; moveIdx < MAX_MON_MOVES; moveIdx++) - party->moves[i * MAX_MON_MOVES + moveIdx] = MOVE_NONE; + for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) + party->moves[i * MAX_MON_MOVES + moveIndex] = MOVE_NONE; party->species[i] = SPECIES_NONE; party->heldItems[i] = ITEM_NONE; @@ -793,8 +793,8 @@ void SetPlayerSecretBaseParty(void) if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) != SPECIES_NONE && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) { - for (moveIdx = 0; moveIdx < MAX_MON_MOVES; moveIdx++) - party->moves[partyId * MAX_MON_MOVES + moveIdx] = GetMonData(&gPlayerParty[i], MON_DATA_MOVE1 + moveIdx); + for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++) + party->moves[partyId * MAX_MON_MOVES + moveIndex] = GetMonData(&gPlayerParty[i], MON_DATA_MOVE1 + moveIndex); party->species[partyId] = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES); party->heldItems[partyId] = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); diff --git a/src/tv.c b/src/tv.c index 26d568642f..dbbf64d33c 100644 --- a/src/tv.c +++ b/src/tv.c @@ -2199,7 +2199,7 @@ void TryPutLotteryWinnerReportOnAir(void) } } -void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove) +void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIndex, const u16 *movePtr, u16 betterMove) { TVShow *show; u8 i; @@ -2214,10 +2214,10 @@ void TryPutBattleSeminarOnAir(u16 foeSpecies, u16 species, u8 moveIdx, const u16 StringCopy(show->battleSeminar.playerName, gSaveBlock2Ptr->playerName); show->battleSeminar.foeSpecies = foeSpecies; show->battleSeminar.species = species; - show->battleSeminar.move = movePtr[moveIdx]; + show->battleSeminar.move = movePtr[moveIndex]; for (i = 0, j = 0; i < MAX_MON_MOVES; i++) { - if (i != moveIdx && movePtr[i]) + if (i != moveIndex && movePtr[i]) { show->battleSeminar.otherMoves[j] = movePtr[i]; j++;