Fix switch out status moves in wild causing softlock

pull/14/head
Flashfyre 2023-12-31 10:39:33 -05:00
parent 5d7f69e35f
commit de87a35b97
1 changed files with 7 additions and 0 deletions

View File

@ -2604,6 +2604,13 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
switchOutTarget.scene.field.remove(switchOutTarget);
user.scene.queueMessage(getPokemonMessage(switchOutTarget, ' fled!'), null, true, 500);
}
if (move.category === MoveCategory.STATUS && !switchOutTarget.getAlly()?.isActive(true)) {
user.scene.clearEnemyHeldItemModifiers();
user.scene.pushPhase(new BattleEndPhase(user.scene));
user.scene.pushPhase(new NewBattlePhase(user.scene));
}
}
resolve(true);