move: fix issue with self switch moves causing softlocks

This commit is contained in:
Madi Simpson authored and Samuel H committed 2024-05-05 12:22:03 -04:00
1 parent fa2d257144
commit b6603e2c6c
1 file changed
+1 -1
+1 -1
View File
@@ -2977,7 +2977,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
return new Promise(resolve => {
// Check if the move category is not STATUS or if the switch out condition is not met
if (!this.getCondition()(user, target, move)) {
if (!this.getSwitchOutCondition()(user, target, move)) {
//Apply effects before switch out i.e. poison point, flame body, etc
applyPostDefendAbAttrs(PostDefendContactApplyStatusEffectAbAttr, target, user, new PokemonMove(move.id), null);
return resolve(false);