Browse Source

fixed a function that still tried to correct the checkboxes on abilities with more than 10 charges.

Warafear 11 months ago
parent
commit
72c3a9d87a

+ 7 - 0
src/app/journal/journal-stats/ability-panel/ability-table/ability-table.component.ts

@@ -77,7 +77,14 @@ export class AbilityTableComponent {
     this.updateDatabase();
   }
 
+  /**
+   * Ticks the first x checkboxes of an ability, where x is the amount of currently used charges.
+   * @param abilityIndex The Index of the ability to correct the charges view for
+   * @returns void
+   */
   public correctChargesView(abilityIndex: number): void {
+    // if there are more than 9 charges, the charges are not handled by checkboxes.
+    if (this.abilities[abilityIndex].charges > 9) return;
     const charges = this.abilities[abilityIndex].charges;
     const currentlyUsedCharges =
       this.abilities[abilityIndex].currentlyUsedCharges;