From 1e786a72b8b26d4674111e019d39907d97a5f18a Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 16 Aug 2025 22:50:32 +0200 Subject: [PATCH] Fixed bug which prevented tera from displaying the saved preference; tera resets in fresh start --- src/ui/starter-select-ui-handler.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 5fa700d8425..2213d3a6d8c 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1142,6 +1142,7 @@ export class StarterSelectUiHandler extends MessageUiHandler { this.starterPreferences = loadStarterPreferences(); this.originalStarterPreferences = loadStarterPreferences(); + console.log("Loaded", this.originalStarterPreferences); this.allSpecies.forEach((species, s) => { const icon = this.starterContainers[s].icon; @@ -1163,6 +1164,7 @@ export class StarterSelectUiHandler extends MessageUiHandler { this.setUpgradeAnimation(icon, species); }); + console.log("Initiated", this.originalStarterPreferences); this.resetFilters(); this.updateStarters(); @@ -2495,14 +2497,14 @@ export class StarterSelectUiHandler extends MessageUiHandler { if (this.canCycleTera) { const speciesForm = getPokemonSpeciesForm(this.lastSpecies.speciesId, starterAttributes.form ?? 0); if (speciesForm.type1 === this.teraCursor && !isNullOrUndefined(speciesForm.type2)) { - starterAttributes.tera = speciesForm.type2!; - originalStarterAttributes.form = starterAttributes.tera; + starterAttributes.tera = speciesForm.type2; + originalStarterAttributes.tera = starterAttributes.tera; this.setSpeciesDetails(this.lastSpecies, { - teraType: speciesForm.type2!, + teraType: speciesForm.type2, }); } else { starterAttributes.tera = speciesForm.type1; - originalStarterAttributes.form = starterAttributes.tera; + originalStarterAttributes.tera = starterAttributes.tera; this.setSpeciesDetails(this.lastSpecies, { teraType: speciesForm.type1, }); @@ -3624,6 +3626,7 @@ export class StarterSelectUiHandler extends MessageUiHandler { variant: props.variant, abilityIndex: defaultAbilityIndex, natureIndex: defaultNature, + teraType: starterAttributes?.tera, }); }