Fix stack overflow with weather abilities

This commit is contained in:
Flashfyre committed 2024-04-11 09:39:15 -04:00
1 parent fbb901e591
commit 43bf8e13ea
4 files changed
+12 -8

No files matched your search

+5 -1
View File
@@ -724,8 +724,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return allAbilities[starterPassiveAbilities[starterSpeciesId]];
}
canApplyPassive(): boolean {
return this.isBoss();
}
canApplyAbility(passive: boolean = false): boolean {
if (passive)
if (passive && !this.canApplyPassive())
return false;
const ability = (!passive ? this.getAbility() : this.getPassiveAbility());
if (ability.isIgnorable && this.scene.arena.ignoreAbilities)