Skip to content

Commit

Permalink
fix Future Sight crash with new catches, attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
MokaStitcher committed Nov 18, 2024
1 parent dd904fe commit dd5592e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pokemon-rogue-battle",
"private": true,
"version": "1.2.1",
"version": "1.2.2",
"type": "module",
"scripts": {
"start": "vite",
Expand Down
8 changes: 8 additions & 0 deletions src/phases/move-effect-phase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit dd5592e

Please sign in to comment.