Fix Toxic and Flame Orb

Shouldn't inflict status conditions on a fainted mon.
This commit is contained in:
BuffelSaft 2021-05-04 22:55:19 +12:00
parent d270dee6bc
commit e8598076a8

View File

@ -6271,7 +6271,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
case HOLD_EFFECT_TOXIC_ORB:
if (!gBattleMons[battlerId].status1
&& CanPoisonType(battlerId, battlerId)
&& GetBattlerAbility(battlerId) != ABILITY_IMMUNITY)
&& GetBattlerAbility(battlerId) != ABILITY_IMMUNITY
&& IsBattlerAlive)
{
effect = ITEM_STATUS_CHANGE;
gBattleMons[battlerId].status1 = STATUS1_TOXIC_POISON;
@ -6282,7 +6283,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
case HOLD_EFFECT_FLAME_ORB:
if (!gBattleMons[battlerId].status1
&& !IS_BATTLER_OF_TYPE(battlerId, TYPE_FIRE)
&& GetBattlerAbility(battlerId) != ABILITY_WATER_VEIL)
&& GetBattlerAbility(battlerId) != ABILITY_WATER_VEIL
&& IsBattlerAlive)
{
effect = ITEM_STATUS_CHANGE;
gBattleMons[battlerId].status1 = STATUS1_BURN;