From c077091dbf917a17f469168c86a84c012a88d2ef Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 15 Oct 2021 14:57:26 -0400 Subject: [PATCH] small fixes, check GetCatchingBattler's semi-invulnerability --- include/constants/battle_config.h | 2 +- src/item_use.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 62c8705e5..fc9bc9f4e 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -178,7 +178,7 @@ #define B_POWDER_GRASS GEN_7 // In Gen6+, Grass-type Pokémon are immune to powder and spore moves. #define B_STEEL_RESISTANCES GEN_7 // In Gen6+, Steel-type Pokémon are no longer resistant to Dark-type and Ghost-type moves. #define B_THUNDERSTORM_TERRAIN TRUE // If TRUE, overworld Thunderstorm generates Rain and Electric Terrain as in Gen 8. -#define B_SEMI_INVULNERABLE_CATCH GEN_4 // In Gen5+, you cannot throw a ball against a Pokemon that is in a semi-invulnerable state (dig/fly/etc) +#define B_SEMI_INVULNERABLE_CATCH GEN_7 // In Gen4+, you cannot throw a ball against a Pokemon that is in a semi-invulnerable state (dig/fly/etc) // Animation Settings #define B_NEW_SWORD_PARTICLE FALSE // If set to TRUE, it updates Swords Dance's particle. diff --git a/src/item_use.c b/src/item_use.c index 93604efef..9a1fd2478 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -947,8 +947,8 @@ u32 CanThrowBall(void) { return 2; // No room for mon } - #if B_SEMI_INVULNERABLE_CATCH >= GEN_5 - else if (gStatuses3[B_POSITION_OPPONENT_LEFT] & STATUS3_SEMI_INVULNERABLE) + #if B_SEMI_INVULNERABLE_CATCH >= GEN_4 + else if (gStatuses3[GetCatchingBattler()] & STATUS3_SEMI_INVULNERABLE) { return 3; // in semi-invulnerable state } @@ -983,7 +983,7 @@ void ItemUseInBattle_PokeBall(u8 taskId) else DisplayItemMessageInBattlePyramid(taskId, gText_BoxFull, Task_CloseBattlePyramidBagMessage); break; - #if B_SEMI_INVULNERABLE_CATCH >= GEN_5 + #if B_SEMI_INVULNERABLE_CATCH >= GEN_4 case 3: // Semi-Invulnerable if (!InBattlePyramid()) DisplayItemMessage(taskId, 1, sText_CantThrowPokeBall_SemiInvulnerable, CloseItemMessage);