From 1b35f9adad4f7471cb8a95ab78b9512d2c239156 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 17 Nov 2021 22:11:03 -0500 Subject: [PATCH] Use specific name limits for string limit functions --- gflib/string_util.c | 12 ++++++------ gflib/string_util.h | 6 +++--- src/apprentice.c | 2 +- src/battle_controller_link_opponent.c | 2 +- src/battle_controller_link_partner.c | 2 +- src/battle_controller_opponent.c | 2 +- src/battle_controller_player.c | 2 +- src/battle_controller_player_partner.c | 2 +- src/battle_controller_recorded_opponent.c | 2 +- src/battle_controller_recorded_player.c | 2 +- src/battle_controller_wally.c | 2 +- src/battle_interface.c | 2 +- src/battle_message.c | 24 +++++++++++------------ src/battle_tower.c | 4 ++-- src/contest.c | 2 +- src/contest_util.c | 2 +- src/daycare.c | 4 ++-- src/evolution_scene.c | 8 ++++---- src/field_poison.c | 2 +- src/lilycove_lady.c | 12 ++++++------ src/lottery_corner.c | 2 +- src/menu_specialized.c | 2 +- src/move_relearner.c | 2 +- src/party_menu.c | 4 ++-- src/pokemon.c | 2 +- src/pokemon_storage_system.c | 4 ++-- src/pokenav_conditions.c | 2 +- src/pokenav_conditions_search_results.c | 2 +- src/pokenav_ribbons_list.c | 2 +- src/pokenav_ribbons_summary.c | 2 +- src/scrcmd.c | 2 +- src/trade.c | 14 ++++++------- src/tv.c | 4 ++-- src/union_room.c | 2 +- src/use_pokeblock.c | 2 +- 35 files changed, 72 insertions(+), 72 deletions(-) diff --git a/gflib/string_util.c b/gflib/string_util.c index 9463b4a7b..bc6f976c7 100644 --- a/gflib/string_util.c +++ b/gflib/string_util.c @@ -25,10 +25,10 @@ static const s32 sPowersOfTen[] = 1000000000, }; -u8 *StringCopy10(u8 *dest, const u8 *src) +u8 *StringCopy_Nickname(u8 *dest, const u8 *src) { u8 i; - u32 limit = 10; + u32 limit = POKEMON_NAME_LENGTH; for (i = 0; i < limit; i++) { @@ -42,10 +42,10 @@ u8 *StringCopy10(u8 *dest, const u8 *src) return &dest[i]; } -u8 *StringGetEnd10(u8 *str) +u8 *StringGet_Nickname(u8 *str) { u8 i; - u32 limit = 10; + u32 limit = POKEMON_NAME_LENGTH; for (i = 0; i < limit; i++) if (str[i] == EOS) @@ -55,10 +55,10 @@ u8 *StringGetEnd10(u8 *str) return &str[i]; } -u8 *StringCopy7(u8 *dest, const u8 *src) +u8 *StringCopy_PlayerName(u8 *dest, const u8 *src) { s32 i; - s32 limit = 7; + s32 limit = PLAYER_NAME_LENGTH; for (i = 0; i < limit; i++) { diff --git a/gflib/string_util.h b/gflib/string_util.h index 7f3b64add..0a8a99fb9 100644 --- a/gflib/string_util.h +++ b/gflib/string_util.h @@ -13,9 +13,9 @@ enum StringConvertMode STR_CONV_MODE_LEADING_ZEROS }; -u8 *StringCopy10(u8 *dest, const u8 *src); -u8 *StringGetEnd10(u8 *str); -u8 *StringCopy7(u8 *dest, const u8 *src); +u8 *StringCopy_Nickname(u8 *dest, const u8 *src); +u8 *StringGet_Nickname(u8 *str); +u8 *StringCopy_PlayerName(u8 *dest, const u8 *src); u8 *StringCopy(u8 *dest, const u8 *src); u8 *StringAppend(u8 *dest, const u8 *src); u8 *StringCopyN(u8 *dest, const u8 *src, u8 n); diff --git a/src/apprentice.c b/src/apprentice.c index 6255b9215..2ab2f0e5a 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -127,7 +127,7 @@ void BufferApprenticeChallengeText(u8 saveApprenticeId) for (i = 0; num != 0 && i < APPRENTICE_COUNT; num /= 10, i++) ; - StringCopy7(gStringVar1, gSaveBlock2Ptr->apprentices[saveApprenticeId].playerName); + StringCopy_PlayerName(gStringVar1, gSaveBlock2Ptr->apprentices[saveApprenticeId].playerName); ConvertInternationalString(gStringVar1, gSaveBlock2Ptr->apprentices[saveApprenticeId].language); ConvertIntToDecimalStringN(gStringVar2, gSaveBlock2Ptr->apprentices[saveApprenticeId].number, STR_CONV_MODE_RIGHT_ALIGN, i); challengeText = sApprenticeChallengeTexts[gSaveBlock2Ptr->apprentices[saveApprenticeId].id]; diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 2ec2e61dc..668dd01b4 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -602,7 +602,7 @@ static u32 CopyLinkOpponentMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID); GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gEnemyParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 0fa156a43..14d806576 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -489,7 +489,7 @@ static u32 CopyLinkPartnerMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 8e1a8327a..c3830780b 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -602,7 +602,7 @@ static u32 GetOpponentMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID); GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gEnemyParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index ff5591e55..2133d5b6f 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -1647,7 +1647,7 @@ static u32 CopyPlayerMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 2c9098271..c2ff08a23 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -673,7 +673,7 @@ static u32 CopyPlayerPartnerMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 54156da35..4a35ef723 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -585,7 +585,7 @@ static u32 CopyRecordedOpponentMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gEnemyParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gEnemyParty[monId], MON_DATA_OT_ID); GetMonData(&gEnemyParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gEnemyParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index a28e87a42..e25482fb5 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -564,7 +564,7 @@ static u32 CopyRecordedPlayerMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index f7c331257..c4c0c11a9 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -491,7 +491,7 @@ static u32 CopyWallyMonData(u8 monId, u8 *dst) battleMon.abilityNum = GetMonData(&gPlayerParty[monId], MON_DATA_ABILITY_NUM); battleMon.otId = GetMonData(&gPlayerParty[monId], MON_DATA_OT_ID); GetMonData(&gPlayerParty[monId], MON_DATA_NICKNAME, nickname); - StringCopy10(battleMon.nickname, nickname); + StringCopy_Nickname(battleMon.nickname, nickname); GetMonData(&gPlayerParty[monId], MON_DATA_OT_NAME, battleMon.otName); src = (u8 *)&battleMon; for (size = 0; size < sizeof(battleMon); size++) diff --git a/src/battle_interface.c b/src/battle_interface.c index 96bab7f90..26209fe2d 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1893,7 +1893,7 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon) StringCopy(gDisplayedStringBattle, gText_HealthboxNickname); GetMonData(mon, MON_DATA_NICKNAME, nickname); - StringGetEnd10(nickname); + StringGet_Nickname(nickname); ptr = StringAppend(gDisplayedStringBattle, nickname); gender = GetMonGender(mon); diff --git a/src/battle_message.c b/src/battle_message.c index b88eedfb3..1df935694 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -2400,7 +2400,7 @@ static const u8* TryGetStatusString(u8 *src) { \ GetMonData(&gPlayerParty[monIndex], MON_DATA_NICKNAME, text); \ } \ - StringGetEnd10(text); \ + StringGet_Nickname(text); \ toCpy = text; u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) @@ -2466,49 +2466,49 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) case B_TXT_PLAYER_MON1_NAME: // first player poke name GetMonData(&gPlayerParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_OPPONENT_MON1_NAME: // first enemy poke name GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_PLAYER_MON2_NAME: // second player poke name GetMonData(&gPlayerParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT)]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_OPPONENT_MON2_NAME: // second enemy poke name GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT)]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_LINK_PLAYER_MON1_NAME: // link first player poke name GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_LINK_OPPONENT_MON1_NAME: // link first opponent poke name GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 1]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_LINK_PLAYER_MON2_NAME: // link second player poke name GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 2]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_LINK_OPPONENT_MON2_NAME: // link second opponent poke name GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerId].id ^ 3]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_ATK_NAME_WITH_PREFIX_MON1: // attacker name with prefix, only battlerId 0/1 @@ -2521,7 +2521,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) else GetMonData(&gEnemyParty[gBattlerPartyIndexes[GetBattlerAtPosition(GET_BATTLER_SIDE(gBattlerAttacker)) + 2]], MON_DATA_NICKNAME, text); - StringGetEnd10(text); + StringGet_Nickname(text); toCpy = text; break; case B_TXT_ATK_NAME_WITH_PREFIX: // attacker name with prefix @@ -2903,7 +2903,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) GetMonData(&gEnemyParty[src[srcID + 2]], MON_DATA_NICKNAME, text); } - StringGetEnd10(text); + StringGet_Nickname(text); StringAppend(dst, text); srcID += 3; break; @@ -2920,7 +2920,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) GetMonData(&gPlayerParty[src[srcID + 2]], MON_DATA_NICKNAME, dst); else GetMonData(&gEnemyParty[src[srcID + 2]], MON_DATA_NICKNAME, dst); - StringGetEnd10(dst); + StringGet_Nickname(dst); srcID += 3; break; case B_BUFF_NEGATIVE_FLAVOR: // flavor table diff --git a/src/battle_tower.c b/src/battle_tower.c index accdca3b4..7ed15d1e6 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -2160,7 +2160,7 @@ static void SaveBattleTowerRecord(void) playerRecord->lvlMode = lvlMode; playerRecord->facilityClass = class; CopyTrainerId(playerRecord->trainerId, gSaveBlock2Ptr->playerTrainerId); - StringCopy7(playerRecord->name, gSaveBlock2Ptr->playerName); + StringCopy_PlayerName(playerRecord->name, gSaveBlock2Ptr->playerName); playerRecord->winStreak = GetCurrentBattleTowerWinStreak(lvlMode, battleMode); for (i = 0; i < EASY_CHAT_BATTLE_WORDS_COUNT; i++) @@ -2831,7 +2831,7 @@ static void FillEReaderTrainerWithPlayerData(void) } CopyTrainerId(ereaderTrainer->trainerId, gSaveBlock2Ptr->playerTrainerId); - StringCopy7(ereaderTrainer->name, gSaveBlock2Ptr->playerName); + StringCopy_PlayerName(ereaderTrainer->name, gSaveBlock2Ptr->playerName); ereaderTrainer->winStreak = 1; diff --git a/src/contest.c b/src/contest.c index b5a035ff8..ced9f90cd 100644 --- a/src/contest.c +++ b/src/contest.c @@ -2794,7 +2794,7 @@ void CreateContestMonFromParty(u8 partyIndex) gContestMons[gContestPlayerMonIndex].highestRank = 0; gContestMons[gContestPlayerMonIndex].species = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPECIES); GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, name); - StringGetEnd10(name); + StringGet_Nickname(name); if (gLinkContestFlags & LINK_CONTEST_FLAG_IS_LINK) { StripMonNameForLinkContest(name, GetMonData(&gPlayerParty[partyIndex], MON_DATA_LANGUAGE)); diff --git a/src/contest_util.c b/src/contest_util.c index 7533d4349..1ca217526 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -2253,7 +2253,7 @@ void Task_LinkContest_FinalizeConnection(u8 taskId) { // Succesfully connected for (i = 0; i < CONTESTANT_COUNT; i++) - StringGetEnd10(gContestMons[i].nickname); + StringGet_Nickname(gContestMons[i].nickname); DestroyTask(taskId); SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE); diff --git a/src/daycare.c b/src/daycare.c index c900e3493..ebbab762a 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -96,7 +96,7 @@ u8 *GetMonNickname2(struct Pokemon *mon, u8 *dest) u8 nickname[POKEMON_NAME_LENGTH * 2]; GetMonData(mon, MON_DATA_NICKNAME, nickname); - return StringCopy10(dest, nickname); + return StringCopy_Nickname(dest, nickname); } u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest) @@ -104,7 +104,7 @@ u8 *GetBoxMonNickname(struct BoxPokemon *mon, u8 *dest) u8 nickname[POKEMON_NAME_LENGTH * 2]; GetBoxMonData(mon, MON_DATA_NICKNAME, nickname); - return StringCopy10(dest, nickname); + return StringCopy_Nickname(dest, nickname); } u8 CountPokemonInDaycare(struct DayCare *daycare) diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 99ff26821..327e48d19 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -252,7 +252,7 @@ void EvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u AllocateMonSpritesGfx(); GetMonData(mon, MON_DATA_NICKNAME, name); - StringCopy10(gStringVar1, name); + StringCopy_Nickname(gStringVar1, name); StringCopy(gStringVar2, gSpeciesNames[postEvoSpecies]); // preEvo sprite @@ -474,7 +474,7 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, u8 preEvoSprit u8 ID; GetMonData(mon, MON_DATA_NICKNAME, name); - StringCopy10(gStringVar1, name); + StringCopy_Nickname(gStringVar1, name); StringCopy(gStringVar2, gSpeciesNames[postEvoSpecies]); gAffineAnimsDisabled = TRUE; @@ -787,7 +787,7 @@ static void Task_EvolutionScene(u8 taskId) gTasks[taskId].tLearnsFirstMove = FALSE; gTasks[taskId].tLearnMoveState = MVSTATE_INTRO_MSG_1; GetMonData(mon, MON_DATA_NICKNAME, text); - StringCopy10(gBattleTextBuff1, text); + StringCopy_Nickname(gBattleTextBuff1, text); if (var == MON_HAS_MAX_MOVES) gTasks[taskId].tState = EVOSTATE_REPLACE_MOVE; @@ -1202,7 +1202,7 @@ static void Task_TradeEvolutionScene(u8 taskId) gTasks[taskId].tLearnsFirstMove = FALSE; gTasks[taskId].tLearnMoveState = 0; GetMonData(mon, MON_DATA_NICKNAME, text); - StringCopy10(gBattleTextBuff1, text); + StringCopy_Nickname(gBattleTextBuff1, text); if (var == MON_HAS_MAX_MOVES) gTasks[taskId].tState = T_EVOSTATE_REPLACE_MOVE; diff --git a/src/field_poison.c b/src/field_poison.c index 132ce571e..90013243c 100644 --- a/src/field_poison.c +++ b/src/field_poison.c @@ -50,7 +50,7 @@ static void FaintFromFieldPoison(u8 partyIdx) AdjustFriendship(pokemon, FRIENDSHIP_EVENT_FAINT_FIELD_PSN); SetMonData(pokemon, MON_DATA_STATUS, &status); GetMonData(pokemon, MON_DATA_NICKNAME, gStringVar1); - StringGetEnd10(gStringVar1); + StringGet_Nickname(gStringVar1); } static bool32 MonFaintedFromPoison(u8 partyIdx) diff --git a/src/lilycove_lady.c b/src/lilycove_lady.c index 0b2be39b5..85340ed96 100644 --- a/src/lilycove_lady.c +++ b/src/lilycove_lady.c @@ -183,7 +183,7 @@ bool8 HasAnotherPlayerGivenFavorLadyItem(void) sFavorLadyPtr = &gSaveBlock1Ptr->lilycoveLady.favor; if (sFavorLadyPtr->playerName[0] != EOS) { - StringCopy7(gStringVar3, sFavorLadyPtr->playerName); + StringCopy_PlayerName(gStringVar3, sFavorLadyPtr->playerName); ConvertInternationalString(gStringVar3, sFavorLadyPtr->language); return TRUE; } @@ -204,7 +204,7 @@ void BufferFavorLadyItemName(void) static void SetFavorLadyPlayerName(const u8 *src, u8 *dest) { memset(dest, EOS, PLAYER_NAME_LENGTH + 1); - StringCopy7(dest, src); + StringCopy_PlayerName(dest, src); } void BufferFavorLadyPlayerName(void) @@ -396,12 +396,12 @@ static u8 BufferQuizAuthorName(void) sQuizLadyPtr = &gSaveBlock1Ptr->lilycoveLady.quiz; if (sQuizLadyPtr->playerName[0] == EOS) { - StringCopy7(gStringVar1, gText_QuizLady_Lady); + StringCopy_PlayerName(gStringVar1, gText_QuizLady_Lady); authorNameId = QUIZ_AUTHOR_NAME_LADY; } else { - StringCopy7(gStringVar1, sQuizLadyPtr->playerName); + StringCopy_PlayerName(gStringVar1, sQuizLadyPtr->playerName); ConvertInternationalString(gStringVar1, sQuizLadyPtr->language); nameLen = GetPlayerNameLength(sQuizLadyPtr->playerName); if (nameLen == GetPlayerNameLength(gSaveBlock2Ptr->playerName)) @@ -552,7 +552,7 @@ void QuizLadyRecordCustomQuizData(void) sQuizLadyPtr->prize = gSpecialVar_ItemId; for (i = 0; i < TRAINER_ID_LENGTH; i++) sQuizLadyPtr->playerTrainerId[i] = gSaveBlock2Ptr->playerTrainerId[i]; - StringCopy7(sQuizLadyPtr->playerName, gSaveBlock2Ptr->playerName); + StringCopy_PlayerName(sQuizLadyPtr->playerName, gSaveBlock2Ptr->playerName); sQuizLadyPtr->language = gGameLanguage; } @@ -696,7 +696,7 @@ static void BufferContestLadyCategoryAndMonName(u8 *category, u8 *nickname) { sContestLadyPtr = &gSaveBlock1Ptr->lilycoveLady.contest; StringCopy(category, sContestLadyCategoryNames[sContestLadyPtr->category]); - StringCopy10(nickname, sContestLadyMonNames[sContestLadyPtr->category]); + StringCopy_Nickname(nickname, sContestLadyMonNames[sContestLadyPtr->category]); } void BufferContestLadyMonName(u8 *category, u8 *nickname) diff --git a/src/lottery_corner.c b/src/lottery_corner.c index 2cbf0a808..f19e9f7b7 100644 --- a/src/lottery_corner.c +++ b/src/lottery_corner.c @@ -113,7 +113,7 @@ void PickLotteryCornerTicket(void) gSpecialVar_0x8006 = 1; GetBoxMonData(&gPokemonStoragePtr->boxes[box][slot], MON_DATA_NICKNAME, gStringVar1); } - StringGetEnd10(gStringVar1); + StringGet_Nickname(gStringVar1); } } diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 20d67ca7f..cd77f4a59 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -919,7 +919,7 @@ static u8 *GetConditionMenuMonString(u8 *dst, u16 boxId, u16 monId) if (GetBoxOrPartyMonData(box, mon, MON_DATA_IS_EGG, NULL)) return StringCopyPadded(dst, gText_EggNickname, 0, 12); GetBoxOrPartyMonData(box, mon, MON_DATA_NICKNAME, dst); - StringGetEnd10(dst); + StringGet_Nickname(dst); species = GetBoxOrPartyMonData(box, mon, MON_DATA_SPECIES, NULL); if (box == TOTAL_BOXES_COUNT) // Party mon. { diff --git a/src/move_relearner.c b/src/move_relearner.c index 92d230616..2b925135f 100644 --- a/src/move_relearner.c +++ b/src/move_relearner.c @@ -912,7 +912,7 @@ static void CreateLearnableMovesList(void) } GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_NICKNAME, nickname); - StringCopy10(gStringVar1, nickname); + StringCopy_Nickname(gStringVar1, nickname); sMoveRelearnerStruct->menuItems[sMoveRelearnerStruct->numMenuChoices].name = gText_Cancel; sMoveRelearnerStruct->menuItems[sMoveRelearnerStruct->numMenuChoices].id = LIST_CANCEL; sMoveRelearnerStruct->numMenuChoices++; diff --git a/src/party_menu.c b/src/party_menu.c index d654afa33..34aff619f 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -953,7 +953,7 @@ static void DisplayPartyPokemonDataForMultiBattle(u8 slot) { menuBox->infoRects->blitFunc(menuBox->windowId, 0, 0, 0, 0, FALSE); StringCopy(gStringVar1, gMultiPartnerParty[actualSlot].nickname); - StringGetEnd10(gStringVar1); + StringGet_Nickname(gStringVar1); ConvertInternationalPlayerName(gStringVar1); DisplayPartyPokemonBarDetail(menuBox->windowId, gStringVar1, 0, menuBox->infoRects->dimensions); DisplayPartyPokemonLevel(gMultiPartnerParty[actualSlot].level, menuBox); @@ -1621,7 +1621,7 @@ static s8 GetNewSlotDoubleLayout(s8 slotId, s8 movementDir) u8* GetMonNickname(struct Pokemon *mon, u8 *dest) { GetMonData(mon, MON_DATA_NICKNAME, dest); - return StringGetEnd10(dest); + return StringGet_Nickname(dest); } #define tKeepOpen data[0] diff --git a/src/pokemon.c b/src/pokemon.c index 1607e1a40..939c2429d 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4647,7 +4647,7 @@ void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex) gBattleMons[battlerId].type2 = gBaseStats[gBattleMons[battlerId].species].type2; gBattleMons[battlerId].ability = GetAbilityBySpecies(gBattleMons[battlerId].species, gBattleMons[battlerId].abilityNum); GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, nickname); - StringCopy10(gBattleMons[battlerId].nickname, nickname); + StringCopy_Nickname(gBattleMons[battlerId].nickname, nickname); GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_NAME, gBattleMons[battlerId].otName); hpSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(battlerId)]; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 727cc5538..755cc7de0 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -6888,7 +6888,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode) sStorage->displayMonIsEgg = GetMonData(mon, MON_DATA_IS_EGG); GetMonData(mon, MON_DATA_NICKNAME, sStorage->displayMonName); - StringGetEnd10(sStorage->displayMonName); + StringGet_Nickname(sStorage->displayMonName); sStorage->displayMonLevel = GetMonData(mon, MON_DATA_LEVEL); sStorage->displayMonMarkings = GetMonData(mon, MON_DATA_MARKINGS); sStorage->displayMonPersonality = GetMonData(mon, MON_DATA_PERSONALITY); @@ -6913,7 +6913,7 @@ static void SetDisplayMonData(void *pokemon, u8 mode) GetBoxMonData(boxMon, MON_DATA_NICKNAME, sStorage->displayMonName); - StringGetEnd10(sStorage->displayMonName); + StringGet_Nickname(sStorage->displayMonName); sStorage->displayMonLevel = GetLevelFromBoxMonExp(boxMon); sStorage->displayMonMarkings = GetBoxMonData(boxMon, MON_DATA_MARKINGS); sStorage->displayMonPersonality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY); diff --git a/src/pokenav_conditions.c b/src/pokenav_conditions.c index e61b11568..94ed4e8d8 100644 --- a/src/pokenav_conditions.c +++ b/src/pokenav_conditions.c @@ -351,7 +351,7 @@ static u8 *CopyConditionMonNameGender(u8 *str, u16 listId, bool8 arg3) return StringCopyPadded(str, gText_EggNickname, CHAR_SPACE, 12); GetBoxOrPartyMonData(boxId, monId, MON_DATA_NICKNAME, str); - StringGetEnd10(str); + StringGet_Nickname(str); species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES, NULL); if (boxId == TOTAL_BOXES_COUNT) { diff --git a/src/pokenav_conditions_search_results.c b/src/pokenav_conditions_search_results.c index c8790e359..bbc07df2c 100644 --- a/src/pokenav_conditions_search_results.c +++ b/src/pokenav_conditions_search_results.c @@ -711,7 +711,7 @@ static void BufferSearchMonListItem(struct PokenavMonListItem * item, u8 * dest) GetBoxMonData(mon, MON_DATA_NICKNAME, gStringVar3); } - StringGetEnd10(gStringVar3); + StringGet_Nickname(gStringVar3); dest = GetStringClearToWidth(dest, FONT_NORMAL, gStringVar3, 60); switch (gender) { diff --git a/src/pokenav_ribbons_list.c b/src/pokenav_ribbons_list.c index 1d72f6a98..724ced507 100644 --- a/src/pokenav_ribbons_list.c +++ b/src/pokenav_ribbons_list.c @@ -721,7 +721,7 @@ static void BufferRibbonMonInfoText(struct PokenavListItem * listItem, u8 * dest GetBoxMonData(mon, MON_DATA_NICKNAME, gStringVar3); } - StringGetEnd10(gStringVar3); + StringGet_Nickname(gStringVar3); dest = GetStringClearToWidth(dest, FONT_NORMAL, gStringVar3, 60); switch (gender) { diff --git a/src/pokenav_ribbons_summary.c b/src/pokenav_ribbons_summary.c index 81d5b900b..581228ff4 100644 --- a/src/pokenav_ribbons_summary.c +++ b/src/pokenav_ribbons_summary.c @@ -397,7 +397,7 @@ static void GetMonNicknameLevelGender(u8 *nick, u8 *level, u8 *gender) *level = GetLevelFromBoxMonExp(boxMon); GetBoxMonData(boxMon, MON_DATA_NICKNAME, nick); } - StringGetEnd10(nick); + StringGet_Nickname(nick); } static void GetMonSpeciesPersonalityOtId(u16 *species, u32 *personality, u32 *otId) diff --git a/src/scrcmd.c b/src/scrcmd.c index 5b7c95e8e..37550abb7 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1575,7 +1575,7 @@ bool8 ScrCmd_bufferpartymonnick(struct ScriptContext *ctx) u16 partyIndex = VarGet(ScriptReadHalfword(ctx)); GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, sScriptStringVars[stringVarIndex]); - StringGetEnd10(sScriptStringVars[stringVarIndex]); + StringGet_Nickname(sScriptStringVars[stringVarIndex]); return FALSE; } diff --git a/src/trade.c b/src/trade.c index a1e4f7094..3e9f033b5 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1880,7 +1880,7 @@ static u8 GetMonNicknameWidth(u8 *str, u8 whichParty, u8 monIdx) else GetMonData(&gEnemyParty[monIdx], MON_DATA_NICKNAME, nickname); - StringCopy10(str, nickname); + StringCopy_Nickname(str, nickname); return GetStringWidth(FONT_SMALL, str, GetFontAttribute(FONT_SMALL, FONTATTR_LETTER_SPACING)); } @@ -1942,7 +1942,7 @@ static void PrintPartyNicknamesForTradeMenu(u8 whichParty) for (i = 0; i < sTradeMenuData->partyCounts[whichParty]; i++) { GetMonData(&party[i], MON_DATA_NICKNAME, nickname); - StringCopy10(str, nickname); + StringCopy_Nickname(str, nickname); PrintMonNicknameForTradeMenu(whichParty, i, str); } } @@ -3266,17 +3266,17 @@ static void BufferTradeSceneStrings(void) mpId = GetMultiplayerId(); StringCopy(gStringVar1, gLinkPlayers[mpId ^ 1].name); GetMonData(&gEnemyParty[gSelectedTradeMonPositions[TRADE_PARTNER] % PARTY_SIZE], MON_DATA_NICKNAME, name); - StringCopy10(gStringVar3, name); + StringCopy_Nickname(gStringVar3, name); GetMonData(&gPlayerParty[gSelectedTradeMonPositions[TRADE_PLAYER]], MON_DATA_NICKNAME, name); - StringCopy10(gStringVar2, name); + StringCopy_Nickname(gStringVar2, name); } else { ingameTrade = &sIngameTrades[gSpecialVar_0x8004]; StringCopy(gStringVar1, ingameTrade->otName); - StringCopy10(gStringVar3, ingameTrade->nickname); + StringCopy_Nickname(gStringVar3, ingameTrade->nickname); GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_NICKNAME, name); - StringCopy10(gStringVar2, name); + StringCopy_Nickname(gStringVar2, name); } } @@ -4479,7 +4479,7 @@ static void BufferInGameTradeMonName(void) u8 nickname[32]; const struct InGameTrade *inGameTrade = &sIngameTrades[gSpecialVar_0x8004]; GetMonData(&gPlayerParty[gSpecialVar_0x8005], MON_DATA_NICKNAME, nickname); - StringCopy10(gStringVar1, nickname); + StringCopy_Nickname(gStringVar1, nickname); StringCopy(gStringVar2, gSpeciesNames[inGameTrade->species]); } diff --git a/src/tv.c b/src/tv.c index de1657813..710b98968 100644 --- a/src/tv.c +++ b/src/tv.c @@ -2959,7 +2959,7 @@ static void InterviewBefore_PkmnFanClubOpinions(void) { StringCopy(gStringVar1, gSpeciesNames[GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_SPECIES, NULL)]); GetMonData(&gPlayerParty[GetLeadMonIndex()], MON_DATA_NICKNAME, gStringVar2); - StringGetEnd10(gStringVar2); + StringGet_Nickname(gStringVar2); InitializeEasyChatWordArray(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubOpinions.words, ARRAY_COUNT(gSaveBlock1Ptr->tvShows[sCurTVShowSlot].fanclubOpinions.words)); } @@ -3325,7 +3325,7 @@ static void ChangeBoxPokemonNickname_CB(void) void BufferMonNickname(void) { GetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar1); - StringGetEnd10(gStringVar1); + StringGet_Nickname(gStringVar1); } void IsMonOTIDNotPlayers(void) diff --git a/src/union_room.c b/src/union_room.c index c624a9784..9a743dbab 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -4502,6 +4502,6 @@ static void ViewURoomPartnerTrainerCard(u8 *unused, struct WirelessLink_URoom *d static void CopyAndTranslatePlayerName(u8 *dest, struct RfuPlayer *player) { - StringCopy7(dest, player->rfu.name); + StringCopy_PlayerName(dest, player->rfu.name); ConvertInternationalString(dest, player->rfu.data.compatibility.language); } diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index 312e2107e..8f041a6ff 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -868,7 +868,7 @@ static void AskUsePokeblock(void) u8 stringBuffer[0x40]; GetMonData(&gPlayerParty[GetPartyIdFromSelectionId(sMenu->info.curSelection)], MON_DATA_NICKNAME, stringBuffer); - StringGetEnd10(stringBuffer); + StringGet_Nickname(stringBuffer); StringAppend(stringBuffer, gText_GetsAPokeBlockQuestion); StringCopy(gStringVar4, stringBuffer); FillWindowPixelBuffer(WIN_TEXT, 17);