Fix duplicate transition at the end of batch hatching
This commit is contained in:
parent
77e8ff3785
commit
6b5bc5b830
|
@ -154,8 +154,9 @@ export class EggHatchPhase extends Phase {
|
|||
});
|
||||
}
|
||||
end() {
|
||||
this.eggHatchHandler.clear()
|
||||
super.end()
|
||||
if (this.scene.findPhase((p) => p instanceof EggHatchPhase))
|
||||
this.eggHatchHandler.clear();
|
||||
super.end();
|
||||
}
|
||||
|
||||
doEggShake(intensity: number, repeatCount?: integer, count?: integer): Promise<void> {
|
||||
|
|
|
@ -4090,19 +4090,17 @@ export class EggLapsePhase extends Phase {
|
|||
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 (--egg.hatchWaves < 1)
|
||||
eggsToHatch.push(egg);
|
||||
}
|
||||
|
||||
if (eggsToHatch.length)
|
||||
if (eggsToHatch.length) {
|
||||
this.scene.queueMessage('Oh?');
|
||||
|
||||
for (let egg of eggsToHatch)
|
||||
this.scene.unshiftPhase(new EggHatchPhase(this.scene, egg));
|
||||
|
||||
|
||||
for (let egg of eggsToHatch)
|
||||
this.scene.unshiftPhase(new EggHatchPhase(this.scene, egg));
|
||||
|
||||
}
|
||||
this.end();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue