diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index e104db758..9fdd54e71 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8916,13 +8916,20 @@ BattleScript_DarkTypePreventsPrankster:: orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT goto BattleScript_MoveEnd +sByteFour: +.byte MAX_BATTLERS_COUNT + BattleScript_NeutralizingGasExits:: + savetarget pause B_WAIT_TIME_SHORT printstring STRINGID_NEUTRALIZINGGASOVER waitmessage B_WAIT_TIME_LONG setbyte gBattlerTarget, 0 BattleScript_NeutralizingGasExitsLoop: + jumpifbyteequal gEffectBattler, gBattlerTarget, BattleScript_NeutralizingGasExitsIncrement @ skip over battler switching out switchinabilities BS_TARGET +BattleScript_NeutralizingGasExitsIncrement: addbyte gBattlerTarget, 1 - jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_NeutralizingGasExitsLoop + jumpifbytenotequal gBattlerTarget, sByteFour, BattleScript_NeutralizingGasExitsLoop @ SOMEHOW, comparing to gBattlersCount is problematic. + restoretarget return diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e2c6aff02..35b04fcd2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -12293,8 +12293,9 @@ static void Cmd_switchoutabilities(void) if (gBattleMons[gActiveBattler].ability == ABILITY_NEUTRALIZING_GAS) { - gBattleMons[gActiveBattler].ability = 0; - BattleScriptPushCursor(); + gBattleMons[gActiveBattler].ability = ABILITY_NONE; + gEffectBattler = gActiveBattler; + BattleScriptPush(gBattlescriptCurrInstr); gBattlescriptCurrInstr = BattleScript_NeutralizingGasExits; } else