Fix Simple Beam

- No longer freezes the game
- Now fails if the target already has simple
- Explicitly checks and changes the target's ability instead of gActiveBattler's ability
This commit is contained in:
BuffelSaft 2021-10-06 15:30:52 +13:00
parent 2119c33989
commit a6198e5d46

View File

@ -7910,15 +7910,15 @@ static void Cmd_various(void)
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;
return; return;
case VARIOUS_SET_SIMPLE_BEAM: case VARIOUS_SET_SIMPLE_BEAM:
if (IsEntrainmentTargetOrSimpleBeamBannedAbility(gBattleMons[gActiveBattler].ability)) if (IsEntrainmentTargetOrSimpleBeamBannedAbility(gBattleMons[gBattlerTarget].ability)
|| gBattleMons[gBattlerTarget].ability == ABILITY_SIMPLE)
{ {
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
} }
else else
{ {
gBattleMons[gActiveBattler].ability = ABILITY_SIMPLE; gBattleMons[gBattlerTarget].ability = ABILITY_SIMPLE;
gBattlescriptCurrInstr += 7; gBattlescriptCurrInstr += 7;
break;
} }
return; return;
case VARIOUS_TRY_ENTRAINMENT: case VARIOUS_TRY_ENTRAINMENT: