Fix race condition in SwitchSummonPhase (#3588)

This commit is contained in:
innerthunder 2024-08-16 17:02:05 -07:00 committed by GitHub
parent 0eb1262f40
commit e697a78fc5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1643,9 +1643,9 @@ export class SwitchSummonPhase extends SummonPhase {
ease: "Sine.easeIn",
scale: 0.5,
onComplete: () => {
// 250ms delay on leaveField is necessary to avoid calling hideInfo() twice
// 300ms delay on leaveField is necessary to avoid calling hideInfo() twice
// and double-animating the stats panel slideout
this.scene.time.delayedCall(250, () => pokemon.leaveField(!this.batonPass));
this.scene.time.delayedCall(300, () => pokemon.leaveField(!this.batonPass));
this.scene.time.delayedCall(750, () => this.switchAndSummon());
}
});