Skip to content

Commit

Permalink
fix: Extends functionality works from Statblocks (close #100)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Apr 22, 2023
1 parent e9108ac commit 055f07e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/utils/creature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class Creature {
if (this.creature.cr) {
return XP_PER_CR[this.creature.cr] ?? 0;
}
const base = plugin.bestiary.find((c) => c.name == this.name);
const base = plugin.getBaseCreatureFromBestiary(this.name);
if (base && base.cr) {
return XP_PER_CR[base.cr] ?? 0;
}
Expand Down
5 changes: 2 additions & 3 deletions src/utils/suggester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,13 @@ export class SRDMonsterSuggestionModal extends SuggestionModal<
}
onChooseItem(item: HomebrewCreature | SRDMonster) {
this.inputEl.value = item.name;
this.creature = item;
this.creature = this.plugin.getBaseCreatureFromBestiary(item.name);
this.onClose();
this.close();
}
selectSuggestion({ item }: FuzzyMatch<HomebrewCreature | SRDMonster>) {
this.inputEl.value = item.name;
this.creature = item;

this.creature = this.plugin.getBaseCreatureFromBestiary(item.name);
this.onClose();
this.close();
}
Expand Down

0 comments on commit 055f07e

Please sign in to comment.