From be4efe5727e5efca7a8b6a3bdbd9ba774ab1d9d8 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Thu, 22 May 2025 12:13:15 -0500 Subject: [PATCH] Force reset summon data and load assets prior to switch in --- src/phases/switch-summon-phase.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/phases/switch-summon-phase.ts b/src/phases/switch-summon-phase.ts index c61eb73118f..5e05d923c67 100644 --- a/src/phases/switch-summon-phase.ts +++ b/src/phases/switch-summon-phase.ts @@ -125,6 +125,12 @@ export class SwitchSummonPhase extends SummonPhase { const switchedInPokemon: Pokemon | undefined = party[this.slotIndex]; this.lastPokemon = this.getPokemon(); + // Defensive programming: Overcome the bug where the summon data has somehow not been reset + // prior to switching in a new Pokemon. + // Force the switch to occur and load the assets for the new pokemon, ignoring override. + switchedInPokemon.resetSummonData(); + switchedInPokemon.loadAssets(true); + applyPreSummonAbAttrs(PreSummonAbAttr, switchedInPokemon); applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, this.lastPokemon); if (!switchedInPokemon) { @@ -132,6 +138,8 @@ export class SwitchSummonPhase extends SummonPhase { return; } + // await globalScene.time.delayedCall(2000 () => ) + if (this.switchType === SwitchType.BATON_PASS) { // If switching via baton pass, update opposing tags coming from the prior pokemon (this.player ? globalScene.getEnemyField() : globalScene.getPlayerField()).forEach((enemyPokemon: Pokemon) =>