Skip to content

Commit

Permalink
fix: fix toggling active abilities when passive ability is clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
MilosDj21 committed Oct 26, 2024
1 parent e7523f1 commit 6c712f8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ui/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,21 @@ export class UI {
this.abilitiesButtons[i].triggerClick();
return i;
}

//If creature has no more available abilities to choose from, return -1
let creatureHaveAtleastOneAvailableAbility = false;
for(let y = i; y < 4; y++){
if(creature.abilities[y].require()){
creatureHaveAtleastOneAvailableAbility = true;
break;
}
}

if(!creatureHaveAtleastOneAvailableAbility){
game.activeCreature.queryMove();
this.selectAbility(-1);
return -1;
}
}
}

Expand Down

0 comments on commit 6c712f8

Please sign in to comment.