[Bug] Add user Pokemon check to multi-hit early stopping (#2726)

This commit is contained in:
innerthunder 2024-06-30 12:21:23 -07:00 committed by GitHub
parent 53ef64f61b
commit f4c8f0080a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -2262,11 +2262,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
/** /**
* If this Pokemon is using a multi-hit move, cancels all subsequent strikes * If this Pokemon is using a multi-hit move, cancels all subsequent strikes
* @param {Pokemon} target If specified, this only cancels subsequent strikes against this Pokemon * @param {Pokemon} target If specified, this only cancels subsequent strikes against the given target
*/ */
stopMultiHit(target?: Pokemon): void { stopMultiHit(target?: Pokemon): void {
const effectPhase = this.scene.getCurrentPhase(); const effectPhase = this.scene.getCurrentPhase();
if (effectPhase instanceof MoveEffectPhase) { if (effectPhase instanceof MoveEffectPhase && effectPhase.getUserPokemon() === this) {
effectPhase.stopMultiHit(target); effectPhase.stopMultiHit(target);
} }
} }