From 5e8c8a6aaf8b565072556e8b38e9905c34baa39e Mon Sep 17 00:00:00 2001 From: Evan Date: Sun, 7 Feb 2021 12:05:55 -0700 Subject: [PATCH] fix ghost types unable to escape from mean look/trap --- src/battle_util.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 8c55ba7ca5..3aa869fadf 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5071,10 +5071,16 @@ u32 IsAbilityPreventingEscape(u32 battlerId) bool32 CanBattlerEscape(u32 battlerId) // no ability check { - return (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_SHED_SHELL - || !((gBattleMons[battlerId].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED)) - || (gStatuses3[battlerId] & STATUS3_ROOTED) - || gFieldStatuses & STATUS_FIELD_FAIRY_LOCK)); + if (GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_SHED_SHELL) + return TRUE; + else if ((B_GHOSTS_ESCAPE >= GEN_6 && !IS_BATTLER_OF_TYPE(battlerId, TYPE_GHOST)) && gBattleMons[battlerId].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED)) + return FALSE; + else if (gStatuses3[battlerId] & STATUS3_ROOTED) + return FALSE; + else if (gFieldStatuses & STATUS_FIELD_FAIRY_LOCK) + return FALSE; + else + return TRUE; } void BattleScriptExecute(const u8 *BS_ptr)