diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/menu_specialized.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/menu_specialized.c b/src/menu_specialized.c index f9da20e11..495f9aa10 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -881,34 +881,31 @@ s32 GetBoxOrPartyMonData(u16 boxId, u16 monId, s32 request, u8 *dst) // Gets the name/gender/level string for the condition menu static u8 *GetConditionMenuMonString(u8 *dst, u16 boxId, u16 monId) { - u16 species, level, gender; + u16 box, mon, species, level, gender; struct BoxPokemon *boxMon; u8 *str; + box = boxId; + mon = monId; *(dst++) = EXT_CTRL_CODE_BEGIN; *(dst++) = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW; *(dst++) = TEXT_COLOR_BLUE; *(dst++) = TEXT_COLOR_TRANSPARENT; *(dst++) = TEXT_COLOR_LIGHT_BLUE; - if (GetBoxOrPartyMonData(boxId, monId, MON_DATA_IS_EGG, NULL)) - { + if (GetBoxOrPartyMonData(box, mon, MON_DATA_IS_EGG, NULL)) return StringCopyPadded(dst, gText_EggNickname, 0, 12); - } - GetBoxOrPartyMonData(boxId, monId, MON_DATA_NICKNAME, dst); + GetBoxOrPartyMonData(box, mon, MON_DATA_NICKNAME, dst); StringGetEnd10(dst); - species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES, NULL); - if (boxId == TOTAL_BOXES_COUNT) // Party mon. + species = GetBoxOrPartyMonData(box, mon, MON_DATA_SPECIES, NULL); + if (box == TOTAL_BOXES_COUNT) // Party mon. { - level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL); - gender = GetMonGender(&gPlayerParty[monId]); + level = GetMonData(&gPlayerParty[mon], MON_DATA_LEVEL); + gender = GetMonGender(&gPlayerParty[mon]); } else { - // Needed to match, feel free to remove. - boxId++, boxId--; - monId++, monId--; + boxMon = GetBoxedMonPtr(box, mon); - boxMon = GetBoxedMonPtr(boxId, monId); gender = GetBoxMonGender(boxMon); level = GetLevelFromBoxMonExp(boxMon); } @@ -981,6 +978,8 @@ static u8 *BufferConditionMenuSpacedStringN(u8 *dst, const u8 *src, s16 n) void GetConditionMenuMonNameAndLocString(u8 *locationDst, u8 *nameDst, u16 boxId, u16 monId, u16 partyId, u16 numMons, bool8 excludesCancel) { u16 i; + u16 box = boxId; + u16 mon = monId; // In this and the below 2 functions, numMons is passed as the number of menu selections (which includes Cancel) // To indicate that the Cancel needs to be subtracted they pass an additional bool @@ -990,21 +989,16 @@ void GetConditionMenuMonNameAndLocString(u8 *locationDst, u8 *nameDst, u16 boxId if (partyId != numMons) { - GetConditionMenuMonString(nameDst, boxId, monId); + GetConditionMenuMonString(nameDst, box, mon); locationDst[0] = EXT_CTRL_CODE_BEGIN; locationDst[1] = EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW; locationDst[2] = TEXT_COLOR_BLUE; locationDst[3] = TEXT_COLOR_TRANSPARENT; locationDst[4] = TEXT_COLOR_LIGHT_BLUE; - if (boxId == TOTAL_BOXES_COUNT) // Party mon. - { + if (box == TOTAL_BOXES_COUNT) // Party mon. BufferConditionMenuSpacedStringN(&locationDst[5], gText_InParty, 8); - } else - { - boxId++;boxId--; // Again...Someone fix this maybe? - BufferConditionMenuSpacedStringN(&locationDst[5], GetBoxNamePtr(boxId), 8); - } + BufferConditionMenuSpacedStringN(&locationDst[5], GetBoxNamePtr(box), 8); } else { |