diff --git a/package-lock.json b/package-lock.json index 22a55cdfa28..9d6e2440f44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.2.1", + "version": "1.2.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.2.1", + "version": "1.2.2", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index 5aaffc59de1..ef2d4938087 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.2.1", + "version": "1.2.2", "type": "module", "scripts": { "start": "vite", diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index 3a609f850c6..f7a9b22c396 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -96,6 +96,14 @@ export class MoveEffectPhase extends PokemonPhase { if (!isDelayedAttack) { return super.end(); } else { + if (!user.scene) { + /** + * This happens if the Pokemon that used the delayed attack gets caught and released + * on the turn the attack would have triggered. Having access to the global scene + * in the future may solve this entirely, so for now we just cancel the hit + */ + return super.end(); + } user.resetTurnData(); } }