diff --git a/src/battle-scene.ts b/src/battle-scene.ts index b02a7ed245c..6d2265d4016 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -2756,6 +2756,7 @@ export default class BattleScene extends SceneBase { for (const queue of [this.phaseQueue, this.phaseQueuePrepend, this.conditionalQueue, this.nextCommandPhaseQueue]) { queue.splice(0, queue.length); } + this.dynamicPhaseQueues.forEach(queue => queue.clear()); this.currentPhase = null; this.standbyPhase = null; this.clearPhaseQueueSplice(); diff --git a/src/data/phase-priority-queue.ts b/src/data/phase-priority-queue.ts index 0849bb1314d..f597f3a9456 100644 --- a/src/data/phase-priority-queue.ts +++ b/src/data/phase-priority-queue.ts @@ -35,6 +35,13 @@ export abstract class PhasePriorityQueue { public push(phase: Phase): void { this.queue.push(phase); } + + /** + * Removes all phases from the queue + */ + public clear(): void { + this.queue.splice(0, this.queue.length); + } } /**