Apply suggestions from code review

This commit is contained in:
Eduardo Quezada D'Ottone 2023-10-05 22:35:44 -03:00 committed by GitHub
parent 0266d3ff82
commit 07a4576ff3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5180,7 +5180,7 @@ static void CB2_ReturnToPartyMenuWhileLearningMove(void)
{
if (sFinalLevel != 0)
SetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_LEVEL, &sFinalLevel); // to avoid displaying incorrect level
if (gSpecialVar_ItemId >= ITEM_RARE_CANDY && gSpecialVar_ItemId <= ITEM_DYNAMAX_CANDY && gPartyMenu.menuType == PARTY_MENU_TYPE_FIELD && CheckBagHasItem(gSpecialVar_ItemId, 1))
if (ItemId_GetFieldFunc(gSpecialVar_ItemId) == ItemUseOutOfBattle_RareCandy && gPartyMenu.menuType == PARTY_MENU_TYPE_FIELD && CheckBagHasItem(gSpecialVar_ItemId, 1))
InitPartyMenu(PARTY_MENU_TYPE_FIELD, PARTY_LAYOUT_SINGLE, PARTY_ACTION_USE_ITEM, TRUE, PARTY_MSG_NONE, Task_ReturnToPartyMenuWhileLearningMove, gPartyMenu.exitCallback);
else
InitPartyMenu(PARTY_MENU_TYPE_FIELD, PARTY_LAYOUT_SINGLE, PARTY_ACTION_CHOOSE_MON, TRUE, PARTY_MSG_NONE, Task_ReturnToPartyMenuWhileLearningMove, gPartyMenu.exitCallback);
@ -5511,7 +5511,7 @@ static void PartyMenuTryEvolution(u8 taskId)
if (targetSpecies != SPECIES_NONE)
{
FreePartyPointers();
if (gSpecialVar_ItemId >= ITEM_RARE_CANDY && gSpecialVar_ItemId <= ITEM_DYNAMAX_CANDY && gPartyMenu.menuType == PARTY_MENU_TYPE_FIELD && CheckBagHasItem(gSpecialVar_ItemId, 1))
if (ItemId_GetFieldFunc(gSpecialVar_ItemId) == ItemUseOutOfBattle_RareCandy && gPartyMenu.menuType == PARTY_MENU_TYPE_FIELD && CheckBagHasItem(gSpecialVar_ItemId, 1))
gCB2_AfterEvolution = CB2_ReturnToPartyMenuUsingRareCandy;
else
gCB2_AfterEvolution = gPartyMenu.exitCallback;