From 7a2b40eada5a03cd2bf817f34605d8bdb5158ebe Mon Sep 17 00:00:00 2001 From: ghoulslash <41651341+ghoulslash@users.noreply.github.com> Date: Wed, 9 Sep 2020 13:33:55 -0600 Subject: [PATCH] Updated Repeated Field Medicine Use (markdown) --- Repeated-Field-Medicine-Use.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) 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;