Tera type not resetting randomly

This commit is contained in:
Wlowscha 2025-08-18 21:43:11 +02:00
parent fd43266d0c
commit 967ad05b8e
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -3739,6 +3739,7 @@ export class StarterSelectUiHandler extends MessageUiHandler {
oldNatureIndex = oldNatureIndex =
this.natureCursor > -1 ? this.natureCursor : globalScene.gameData.getSpeciesDefaultNature(species, dexEntry); this.natureCursor > -1 ? this.natureCursor : globalScene.gameData.getSpeciesDefaultNature(species, dexEntry);
} }
const oldTeraType = this.teraCursor > -1 ? this.teraCursor : species ? species.type1 : PokemonType.UNKNOWN;
this.dexAttrCursor = 0n; this.dexAttrCursor = 0n;
this.abilityCursor = -1; this.abilityCursor = -1;
this.natureCursor = -1; this.natureCursor = -1;
@ -3785,7 +3786,7 @@ export class StarterSelectUiHandler extends MessageUiHandler {
); // TODO: is this bang correct? ); // TODO: is this bang correct?
this.abilityCursor = abilityIndex !== undefined ? abilityIndex : (abilityIndex = oldAbilityIndex); this.abilityCursor = abilityIndex !== undefined ? abilityIndex : (abilityIndex = oldAbilityIndex);
this.natureCursor = natureIndex !== undefined ? natureIndex : (natureIndex = oldNatureIndex); this.natureCursor = natureIndex !== undefined ? natureIndex : (natureIndex = oldNatureIndex);
this.teraCursor = !isNullOrUndefined(teraType) ? teraType : (teraType = species.type1); this.teraCursor = !isNullOrUndefined(teraType) ? teraType : (teraType = oldTeraType);
const [isInParty, partyIndex]: [boolean, number] = this.isInParty(species); // we use this to firstly check if the pokemon is in the party, and if so, to get the party index in order to update the icon image const [isInParty, partyIndex]: [boolean, number] = this.isInParty(species); // we use this to firstly check if the pokemon is in the party, and if so, to get the party index in order to update the icon image
if (isInParty) { if (isInParty) {
this.updatePartyIcon(species, partyIndex); this.updatePartyIcon(species, partyIndex);