From d87610a1e0a6831812b90e24109430921b6dc728 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 20 Jul 2022 15:31:08 -0400 Subject: [PATCH] Ghost Escape config AI fix --- src/battle_ai_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index b8c42ed0c..02f2e8228 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -606,7 +606,7 @@ bool32 AtMaxHp(u8 battlerId) bool32 IsBattlerTrapped(u8 battler, bool8 checkSwitch) { u8 holdEffect = AI_DATA->holdEffects[battler]; - if (IS_BATTLER_OF_TYPE(battler, TYPE_GHOST) + if ((B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GHOST)) || (checkSwitch && holdEffect == HOLD_EFFECT_SHED_SHELL) || (!checkSwitch && GetBattlerAbility(battler) == ABILITY_RUN_AWAY) || (!checkSwitch && holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN))