[Hotfix] Prevent more Future Sight crash with new catches (#4910)

This commit is contained in:
Moka 2024-11-18 19:41:24 +01:00 committed by GitHub
parent dd904fe782
commit 0c920ba195
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 3 deletions

4
package-lock.json generated
View File

@ -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",

View File

@ -1,7 +1,7 @@
{
"name": "pokemon-rogue-battle",
"private": true,
"version": "1.2.1",
"version": "1.2.2",
"type": "module",
"scripts": {
"start": "vite",

View File

@ -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();
}
}