[Hotfix] Fix wild spawns not having their HA (#3190)

This commit is contained in:
NightKev 2024-07-28 14:06:38 -07:00 committed by GitHub
parent a8adfc2476
commit f25d4e1ee2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -135,10 +135,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
// If abilityIndex is not provided, determine it based on species and hidden ability
if (species.abilityHidden && hasHiddenAbility) {
// If the species has a hidden ability and the hidden ability is present
this.abilityIndex = species.ability2 ? 2 : 1; // Use ability index 2 if species has a second ability, otherwise use 1
this.abilityIndex = 2;
} else {
// If there is no hidden ability or species does not have a hidden ability
this.abilityIndex = species.ability2 ? randAbilityIndex : 0; // Use random ability index if species has a second ability, otherwise use 0
this.abilityIndex = species.ability2 !== species.ability1 ? randAbilityIndex : 0; // Use random ability index if species has a second ability, otherwise use 0
}
}
if (formIndex !== undefined) {