From a7a97695f1ada31687c1b5583a82375cb3fc7d3b Mon Sep 17 00:00:00 2001 From: Dean <69436131+emdeann@users.noreply.github.com> Date: Tue, 16 Sep 2025 10:44:38 -0700 Subject: [PATCH] Remove null from `nextPhase` --- src/phase-manager.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/phase-manager.ts b/src/phase-manager.ts index f19bd0e6305..b0c2b9e9428 100644 --- a/src/phase-manager.ts +++ b/src/phase-manager.ts @@ -238,8 +238,7 @@ const turnEndPhases: PhaseString[] = [ */ export class PhaseManager { /** PhaseQueue: dequeue/remove the first element to get the next phase */ - private phaseQueue: PhaseTree = new PhaseTree(); - private nextCommandPhaseQueue: Phase[] = []; + private readonly phaseQueue: PhaseTree = new PhaseTree(); /** Holds priority queues for dynamically ordered phases */ public dynamicQueueManager = new DynamicQueueManager(); @@ -334,13 +333,13 @@ export class PhaseManager { return; } - let nextPhase = this.phaseQueue.getNextPhase() ?? null; + let nextPhase = this.phaseQueue.getNextPhase(); if (nextPhase?.is("DynamicPhaseMarker")) { - nextPhase = this.dynamicQueueManager.popNextPhase(nextPhase.phaseType) ?? null; + nextPhase = this.dynamicQueueManager.popNextPhase(nextPhase.phaseType); } - if (nextPhase === null) { + if (nextPhase == null) { this.turnStart(); } else { this.currentPhase = nextPhase; @@ -525,7 +524,7 @@ export class PhaseManager { && !this.phaseQueue.exists("SummonPhase") ) { globalScene.getEnemyField().forEach(p => { - this.pushPhase(new PostSummonPhase(p.getBattlerIndex(), "SummonPhase")) + this.pushPhase(new PostSummonPhase(p.getBattlerIndex(), "SummonPhase")); }); } }