Followed Ghoulslash's suggestion

This commit is contained in:
LOuroboros 2021-06-08 11:34:23 -03:00
parent 2c1237365b
commit d849c31ee8
2 changed files with 1 additions and 25 deletions

View file

@ -138,7 +138,6 @@ bool32 IsTelekinesisBannedSpecies(u16 species);
bool32 IsHealBlockPreventingMove(u32 battler, u32 move);
bool32 IsThawingMove(u8 battlerId, u16 move);
bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId);
bool32 IsLastAliveMonInParty(u8 battlerId);
// ability checks
bool32 IsRolePlayBannedAbilityAtk(u16 ability);

View file

@ -4649,7 +4649,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& !(GetBattlerAbility(gBattlerAttacker) == ABILITY_SHEER_FORCE && gBattleMoves[gCurrentMove].flags & FLAG_SHEER_FORCE_BOOST)
&& (CanBattlerSwitch(battler) || !(gBattleTypeFlags & BATTLE_TYPE_TRAINER))
&& !(gBattleTypeFlags & BATTLE_TYPE_ARENA)
&& !IsLastAliveMonInParty(battler))
&& CountUsablePartyMons(battler) > 0)
{
gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_EMERGENCY_EXIT;
effect++;
@ -8672,26 +8672,3 @@ bool32 IsEntrainmentTargetOrSimpleBeamBannedAbility(u16 ability)
}
return FALSE;
}
bool32 IsLastAliveMonInParty(u8 battlerId)
{
struct Pokemon *party;
u8 i;
u8 count = 0;
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER)
party = gPlayerParty;
else
party = gEnemyParty;
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&party[i], MON_DATA_HP) != 0)
count++;
}
if (count > 1)
return FALSE;
else
return TRUE;
}