Fix issues with out of bounds form indexes

This commit is contained in:
Flashfyre committed 2024-02-21 12:38:07 -05:00
1 parent 355fbac9c3
commit 0917049fea
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -352,7 +352,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm {
getName(formIndex?: integer): string {
if (formIndex !== undefined && this.forms.length) {
const form = this.forms[Math.min(formIndex, this.forms.length - 1)];
const form = this.forms[formIndex];
switch (form.formKey) {
case SpeciesFormKey.MEGA:
case SpeciesFormKey.ETERNAMAX: