Missing IsBattlerAlive checks in Opportunist/Mirror Herb (#7829)

This commit is contained in:
Alex 2025-09-30 23:44:40 +02:00 committed by GitHub
parent 3ea095a941
commit ad7c944f9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6715,6 +6715,8 @@ static void Cmd_moveend(void)
while (gBattleStruct->moveEndBattlerId < gBattlersCount)
{
u32 battler = gBattleStruct->moveEndBattlerId++;
if (!IsBattlerAlive(battler))
continue;
if (AbilityBattleEffects(ABILITYEFFECT_OPPORTUNIST, battler, GetBattlerAbility(battler), 0, 0))
return;
}
@ -6725,6 +6727,8 @@ static void Cmd_moveend(void)
while (gBattleStruct->moveEndBattlerId < gBattlersCount)
{
u32 battler = gBattleStruct->moveEndBattlerId++;
if (!IsBattlerAlive(battler))
continue;
if (ItemBattleEffects(ITEMEFFECT_MIRROR_HERB, battler))
return;
}