Skip to content

Commit

Permalink
fix: getting a player by name now returns a creature if no player exists
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed May 8, 2023
1 parent 3fb298f commit 0549522
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ 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));
}
getPlayersForParty(party: string) {
Expand Down

0 comments on commit 0549522

Please sign in to comment.