mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 15:03:24 +02:00
Remove null from nextPhase
This commit is contained in:
parent
7b62233e83
commit
a7a97695f1
@ -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"));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user