[Misc] OPP_FORM_OVERRIDES now accepts 0 as a valid form index (#5514)

This commit is contained in:
NightKev 2025-03-13 14:48:53 -07:00 committed by GitHub
parent 4e1ee9e50b
commit e8e0041ed0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 4 deletions

View File

@ -6916,10 +6916,10 @@ export class EnemyPokemon extends Pokemon {
if (
speciesId in Overrides.OPP_FORM_OVERRIDES &&
Overrides.OPP_FORM_OVERRIDES[speciesId] &&
!isNullOrUndefined(Overrides.OPP_FORM_OVERRIDES[speciesId]) &&
this.species.forms[Overrides.OPP_FORM_OVERRIDES[speciesId]]
) {
this.formIndex = Overrides.OPP_FORM_OVERRIDES[speciesId] ?? 0;
this.formIndex = Overrides.OPP_FORM_OVERRIDES[speciesId];
}
if (!dataSource) {

View File

@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/consistent-type-imports */
import { type PokeballCounts } from "#app/battle-scene";
import { EvolutionItem } from "#app/data/balance/pokemon-evolutions";
import { Gender } from "#app/data/gender";

View File

@ -53,6 +53,7 @@ export class SelectStarterPhase extends Phase {
let starterFormIndex = Math.min(starterProps.formIndex, Math.max(starter.species.forms.length - 1, 0));
if (
starter.species.speciesId in Overrides.STARTER_FORM_OVERRIDES &&
!Utils.isNullOrUndefined(Overrides.STARTER_FORM_OVERRIDES[starter.species.speciesId]) &&
starter.species.forms[Overrides.STARTER_FORM_OVERRIDES[starter.species.speciesId]!]
) {
starterFormIndex = Overrides.STARTER_FORM_OVERRIDES[starter.species.speciesId]!;