cleaning up some code

This commit is contained in:
PrabbyDD 2024-09-23 17:04:11 -07:00
parent 7d2b053b3e
commit 1db628633d

View File

@ -3972,7 +3972,8 @@ export class PlayerPokemon extends Pokemon {
let compatible = false; let compatible = false;
for (const p of tmSpecies[tm]) { for (const p of tmSpecies[tm]) {
if (Array.isArray(p)) { if (Array.isArray(p)) {
if ((p[0] === this.species.speciesId || this.fusionSpecies && p[0] === this.fusionSpecies.speciesId) && p.slice(1).indexOf(this.species.forms[this.formIndex]) > -1) { const [pkm, ...forms] = p;
if ((pkm === this.species.speciesId || this.fusionSpecies && pkm === this.fusionSpecies.speciesId) && forms.some(form => form === this.species.forms[this.formIndex])) {
compatible = true; compatible = true;
break; break;
} }