[Bug] Skip forced switch if the fainted party member has been revived already (#1236)

This commit is contained in:
Jacob Knispel 2024-08-04 00:04:59 -05:00 committed by GitHub
parent fdcf21592b
commit ca64c4aaf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4468,6 +4468,10 @@ export class SwitchPhase extends BattlePhase {
return super.end();
}
// Skip if the fainted party member has been revived already
if (this.isModal && !this.scene.getParty()[this.fieldIndex].isFainted())
return super.end();
// Check if there is any space still in field
if (this.isModal && this.scene.getPlayerField().filter(p => p.isAllowedInBattle() && p.isActive(true)).length >= this.scene.currentBattle.getBattlerCount()) {
return super.end();