Remove null from nextPhase

This commit is contained in:
Dean 2025-09-16 10:44:38 -07:00
parent 7b62233e83
commit a7a97695f1

View File

@ -238,8 +238,7 @@ const turnEndPhases: PhaseString[] = [
*/ */
export class PhaseManager { export class PhaseManager {
/** PhaseQueue: dequeue/remove the first element to get the next phase */ /** PhaseQueue: dequeue/remove the first element to get the next phase */
private phaseQueue: PhaseTree = new PhaseTree(); private readonly phaseQueue: PhaseTree = new PhaseTree();
private nextCommandPhaseQueue: Phase[] = [];
/** Holds priority queues for dynamically ordered phases */ /** Holds priority queues for dynamically ordered phases */
public dynamicQueueManager = new DynamicQueueManager(); public dynamicQueueManager = new DynamicQueueManager();
@ -334,13 +333,13 @@ export class PhaseManager {
return; return;
} }
let nextPhase = this.phaseQueue.getNextPhase() ?? null; let nextPhase = this.phaseQueue.getNextPhase();
if (nextPhase?.is("DynamicPhaseMarker")) { 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(); this.turnStart();
} else { } else {
this.currentPhase = nextPhase; this.currentPhase = nextPhase;
@ -525,7 +524,7 @@ export class PhaseManager {
&& !this.phaseQueue.exists("SummonPhase") && !this.phaseQueue.exists("SummonPhase")
) { ) {
globalScene.getEnemyField().forEach(p => { globalScene.getEnemyField().forEach(p => {
this.pushPhase(new PostSummonPhase(p.getBattlerIndex(), "SummonPhase")) this.pushPhase(new PostSummonPhase(p.getBattlerIndex(), "SummonPhase"));
}); });
} }
} }