Plug leaks in egg hatch phases

Co-authored-by: MokaStitcher <54149968+MokaStitcher@users.noreply.github.com>
This commit is contained in:
Sirz Benjie 2025-09-07 16:59:12 -05:00
parent 7001f78beb
commit 745be8cb42
No known key found for this signature in database
GPG Key ID: 4A524B4D196C759E
2 changed files with 5 additions and 0 deletions

View File

@ -230,6 +230,7 @@ export class EggHatchPhase extends Phase {
} else {
globalScene.time.delayedCall(250, () => globalScene.setModifiersVisible(true));
}
this.pokemon?.destroy();
super.end();
}

View File

@ -39,6 +39,10 @@ export class EggSummaryPhase extends Phase {
}
end() {
this.eggHatchData.forEach(data => {
data.pokemon?.destroy();
});
this.eggHatchData = [];
globalScene.time.delayedCall(250, () => globalScene.setModifiersVisible(true));
globalScene.ui.setModeForceTransition(UiMode.MESSAGE).then(() => {
super.end();