Skip to content

Commit

Permalink
fix: Encounters pull FS creatures correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed May 17, 2023
1 parent d6444b8 commit 0db3845
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/encounter/ui/Encounter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
setContext("plugin", plugin);
export let name: string = "Encounter";
export let creatures: Map<Creature, number | string>;
export let creatures: Map<Creature, number | string> = new Map();
export let players: string[];
export let party: string = null;
export let hide: string[] = [];
Expand Down Expand Up @@ -63,7 +63,7 @@
difficulty = encounterDifficulty(
playerLevels,
totalXP,
[...creatureMap.values()].reduce((acc, curr) => acc + curr)
[...creatureMap.values()].reduce((acc, curr) => acc + curr, 0)
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export default class InitiativeTracker extends Plugin {
}

getPlayerByName(name: string) {
if (!this.playerCreatures.has(name)) return new Creature({ name });
return Creature.from(this.playerCreatures.get(name));
if (!this.players.has(name)) return new Creature({ name });
return Creature.from(this.players.get(name));
}
getPlayersForParty(party: string) {
return (
Expand Down

0 comments on commit 0db3845

Please sign in to comment.