Skip to content

Commit

Permalink
Can only use box link if the map allows escape
Browse files Browse the repository at this point in the history
  • Loading branch information
kittenchilly committed Sep 13, 2023
1 parent 4dbb601 commit be5b46b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/item_use.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static u8 GetDirectionToHiddenItem(s16, s16);
static void PlayerFaceHiddenItem(u8);
static void CheckForHiddenItemsInMapConnection(u8);
static void Task_OpenRegisteredPokeblockCase(u8);
static void Task_WaitFadeAccessPokemonBoxLink(u8);
static void Task_AccessPokemonBoxLink(u8);
static void ItemUseOnFieldCB_Bike(u8);
static void ItemUseOnFieldCB_Rod(u8);
static void ItemUseOnFieldCB_Itemfinder(u8);
Expand Down Expand Up @@ -681,17 +681,20 @@ static void Task_OpenRegisteredPokeblockCase(u8 taskId)

void ItemUseOutOfBattle_PokemonBoxLink(u8 taskId)
{
sItemUseOnFieldCB = Task_WaitFadeAccessPokemonBoxLink;
SetUpItemUseOnFieldCallback(taskId);
if (CanUseDigOrEscapeRopeOnCurMap)
{
sItemUseOnFieldCB = Task_AccessPokemonBoxLink;
SetUpItemUseOnFieldCallback(taskId);
}
else
DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].tUsingRegisteredKeyItem);

}

static void Task_WaitFadeAccessPokemonBoxLink(u8 taskId)
static void Task_AccessPokemonBoxLink(u8 taskId)
{
if (!gPaletteFade.active)
{
ScriptContext_SetupScript(EventScript_AccessPokemonBoxLink);
DestroyTask(taskId);
}
ScriptContext_SetupScript(EventScript_AccessPokemonBoxLink);
DestroyTask(taskId);
}

void ItemUseOutOfBattle_CoinCase(u8 taskId)
Expand Down

0 comments on commit be5b46b

Please sign in to comment.