From b673738ba5f7e14e5830379d3a83823c7758145f Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Thu, 21 Sep 2023 16:26:00 +0200 Subject: [PATCH] Add config for pressing B in the PC --- include/config/overworld.h | 3 +++ src/pokemon_storage_system.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/include/config/overworld.h b/include/config/overworld.h index f62588b5f..e8056236a 100644 --- a/include/config/overworld.h +++ b/include/config/overworld.h @@ -7,6 +7,9 @@ // Other settings #define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all. +// PC settings +#define OW_PC_PRESS_B GEN_LATEST // In Gen4, pressing B when holding a Pokémon is equivalent to placing it. In Gen3, it gives the "You're holding a Pokémon!" error. + // Overworld flags // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. // Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag to toggle the feature. diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 9cb894f13..849c523b8 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -3685,9 +3685,14 @@ static void Task_OnBPressed(u8 taskId) case 0: if (IsMonBeingMoved()) { + #if OW_PC_PRESS_B < GEN_4 PlaySE(SE_FAILURE); PrintMessage(MSG_HOLDING_POKE); sStorage->state = 1; + #else + PlaySE(SE_SELECT); + SetPokeStorageTask(Task_PlaceMon); + #endif } else if (IsMovingItem()) {