Merge pull request #2203 from AsparagusEduardo/BE_ghostEscapeAiFix

Ghost Escape config AI fix
This commit is contained in:
ghoulslash 2022-07-21 16:00:33 -04:00 committed by GitHub
commit 2fc15ab779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))