diff --git a/src/item_use.c b/src/item_use.c index c65aaa095fc0..f28718436c76 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -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); @@ -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)