Skip to content

Commit

Permalink
fix(combat): if an ability is removed from the game, it will not caus…
Browse files Browse the repository at this point in the history
…e loadout errors
  • Loading branch information
seiyria committed Mar 29, 2023
1 parent 5042ee8 commit ce8a90e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stores/combat/combat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ export class CombatState {
.map(item => item ? this.itemCreator.migrateItem(item) : undefined)
.filter(Boolean);

ctx.setState(patch<IGameCombat>({ activeItems, activeFoods }));
const activeSkills = state.activeSkills
.map(skill => this.contentService.getAbilityByName(skill) ? skill : undefined)
.filter(Boolean) as string[];

ctx.setState(patch<IGameCombat>({ activeItems, activeFoods, activeSkills }));
}

@Action(InitiateCombat)
Expand Down

0 comments on commit ce8a90e

Please sign in to comment.