From ad34bb7f0d5018aa485c29e864b890b62ffce156 Mon Sep 17 00:00:00 2001 From: Milos Date: Sat, 26 Oct 2024 12:03:05 +0200 Subject: [PATCH] fix: fix toggling active abilities when passive ability is clicked --- src/ui/interface.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/interface.js b/src/ui/interface.js index efb2b4da1..04c9406c2 100644 --- a/src/ui/interface.js +++ b/src/ui/interface.js @@ -759,7 +759,7 @@ export class UI { return i; } - //If creature has no more available abilities to choose from, return -1 + //Check if creature has at least one more ability to choose from let creatureHaveAtleastOneAvailableAbility = false; for(let y = i; y < 4; y++){ if(creature.abilities[y].require()){ @@ -768,6 +768,7 @@ export class UI { } } + //If creature has no more available abilities to choose from, return -1 if(!creatureHaveAtleastOneAvailableAbility){ game.activeCreature.queryMove(); this.selectAbility(-1);