Fix duplicate transition at the end of batch hatching
parent
77e8ff3785
commit
6b5bc5b830
|
@ -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> {
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue