Fix duplicate transition at the end of batch hatching

This commit is contained in:
Matthew authored and Samuel H committed 2024-04-05 17:53:36 -04:00
1 parent 77e8ff3785
commit 6b5bc5b830
2 files changed
+12 -13

No files matched your search

+3 -2
View File
@@ -154,8 +154,9 @@ export class EggHatchPhase extends Phase {
}); });
} }
end() { end() {
this.eggHatchHandler.clear() if (this.scene.findPhase((p) => p instanceof EggHatchPhase))
super.end() this.eggHatchHandler.clear();
super.end();
} }
doEggShake(intensity: number, repeatCount?: integer, count?: integer): Promise<void> { doEggShake(intensity: number, repeatCount?: integer, count?: integer): Promise<void> {
+9 -11
View File
@@ -4090,19 +4090,17 @@ export class EggLapsePhase extends Phase {
start() { start() {
super.start(); super.start();
const eggsToHatch: Egg[] = []; const eggsToHatch: Egg[] = this.scene.gameData.eggs.filter((egg: Egg) => {
return --egg.hatchWaves < 1
})
for (let egg of this.scene.gameData.eggs) { if (eggsToHatch.length) {
if (--egg.hatchWaves < 1)
eggsToHatch.push(egg);
}
if (eggsToHatch.length)
this.scene.queueMessage('Oh?'); this.scene.queueMessage('Oh?');
for (let egg of eggsToHatch) for (let egg of eggsToHatch)
this.scene.unshiftPhase(new EggHatchPhase(this.scene, egg)); this.scene.unshiftPhase(new EggHatchPhase(this.scene, egg));
}
this.end(); this.end();
} }
} }