Skip to content

Commit

Permalink
[Hotfix] Fix wild spawns not having their HA (pagefaultgames#3190)
Browse files Browse the repository at this point in the history
  • Loading branch information
DayKev authored Jul 28, 2024
1 parent a8adfc2 commit f25d4e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/field/pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f25d4e1

Please sign in to comment.