diff --git a/Repeated-Field-Medicine-Use.md b/Repeated-Field-Medicine-Use.md index f9cb188..db56533 100644 --- a/Repeated-Field-Medicine-Use.md +++ b/Repeated-Field-Medicine-Use.md @@ -6,9 +6,20 @@ If you're using a lot of potions at once, it can be annoying to keep returning t Let's start by opening [src/party_menu.c](../blob/master/src/party_menu.c) -### Handle Medicine +### 1. -Find the function `ItemUseCB_Medicine`. Towards the end of the function, replace +First, find the function `ItemUseCB_Medicine`. Inside the code block that starts with `if (ExecuteTableBasedItemEffect_(gPartyMenu.slotId, item, 0))`, replace `gTasks[taskId].func = task;` with: +```c +if (gPartyMenu.menuType == PARTY_MENU_TYPE_FIELD) + gTasks[taskId].func = Task_ReturnToChooseMonAfterText; +else + gTasks[taskId].func = task; +``` + + +### 2. + +Next, stay in the function `ItemUseCB_Medicine`. Towards the end of the function, replace ```c ..... else @@ -38,7 +49,9 @@ with } ``` -Next, find `Task_DisplayHPRestoredMessage`. Replace `gTasks[taskId].func = Task_ClosePartyMenuAfterText;` with: +### 3. + +Finally, find `Task_DisplayHPRestoredMessage`. Replace `gTasks[taskId].func = Task_ClosePartyMenuAfterText;` with: ```c if (gPartyMenu.menuType == PARTY_MENU_TYPE_FIELD && CheckBagHasItem(gSpecialVar_ItemId, 1)) gTasks[taskId].func = Task_ReturnToChooseMonAfterText;