hotfix save AFTER egg is made

This commit is contained in:
Matthew Olker 2024-06-21 21:59:58 -04:00
parent 6c0602b3f8
commit d6cc28ea69

View File

@ -1414,15 +1414,15 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
starterData.candyCount -= sameSpeciesEggCost; starterData.candyCount -= sameSpeciesEggCost;
} }
this.pokemonCandyCountText.setText(`x${starterData.candyCount}`); this.pokemonCandyCountText.setText(`x${starterData.candyCount}`);
const egg = new Egg({scene: this.scene, species: this.lastSpecies.speciesId, sourceType: EggSourceType.SAME_SPECIES_EGG});
egg.addEggToGameData(this.scene);
this.scene.gameData.saveSystem().then(success => { this.scene.gameData.saveSystem().then(success => {
if (!success) { if (!success) {
return this.scene.reset(true); return this.scene.reset(true);
} }
}); });
const egg = new Egg({scene: this.scene, species: this.lastSpecies.speciesId, sourceType: EggSourceType.SAME_SPECIES_EGG});
egg.addEggToGameData(this.scene);
ui.setMode(Mode.STARTER_SELECT); ui.setMode(Mode.STARTER_SELECT);
this.scene.playSound("buy"); this.scene.playSound("buy");