From e180611de6bdf770bad757a9b178c0bb206918e8 Mon Sep 17 00:00:00 2001 From: Jaizu Date: Sat, 29 Jul 2023 21:13:49 +0200 Subject: [PATCH] Compare to ITEM_HM01 and not ITEM_TM50 (#634) * Compare to ITEM_HM01 and not ITEM_TM50 While both compile to the same output when doing test functions in https://cexplore.karathan.at/, shinny pointed in the discord that, if you expand TMs, using ITEM_TM50 would break things. This was the previous behaviour but was changed by cbt when documented the party menu. This was pointed out but HunarPG in the pokefirered Discord channel. * Use ITEM_HM01 instead. --- src/party_menu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/party_menu.c b/src/party_menu.c index 348bbf3a4..ac97907c5 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -4291,7 +4291,7 @@ static void CB2_UseItem(void) { GiveMoveToMon(&gPlayerParty[gPartyMenu.slotId], ItemIdToBattleMoveId(gSpecialVar_ItemId)); AdjustFriendship(&gPlayerParty[gPartyMenu.slotId], FRIENDSHIP_EVENT_LEARN_TMHM); - if (gSpecialVar_ItemId <= ITEM_TM50) + if (gSpecialVar_ItemId < ITEM_HM01) RemoveBagItem(gSpecialVar_ItemId, 1); SetMainCallback2(gPartyMenu.exitCallback); } @@ -4311,7 +4311,7 @@ static void CB2_UseTMHMAfterForgettingMove(void) SetMonMoveSlot(mon, ItemIdToBattleMoveId(gSpecialVar_ItemId), moveIdx); AdjustFriendship(mon, FRIENDSHIP_EVENT_LEARN_TMHM); ItemUse_SetQuestLogEvent(QL_EVENT_USED_ITEM, mon, gSpecialVar_ItemId, move); - if (gSpecialVar_ItemId <= ITEM_TM50) + if (gSpecialVar_ItemId < ITEM_HM01) RemoveBagItem(gSpecialVar_ItemId, 1); SetMainCallback2(gPartyMenu.exitCallback); } @@ -4815,7 +4815,7 @@ static void Task_LearnedMove(u8 taskId) if (learnMoveMethod == LEARN_VIA_TMHM) { AdjustFriendship(mon, FRIENDSHIP_EVENT_LEARN_TMHM); - if (item <= ITEM_TM50) + if (item < ITEM_HM01) RemoveBagItem(item, 1); } GetMonNickname(mon, gStringVar1);