javalent / initiative-tracker

TTRPG Initiative Tracker for Obsidian.md
GNU General Public License v3.0
144 stars 30 forks source link

šŸž Inline statblock players duplicated on encounter start #251

Open bjornnorgaard opened 6 months ago

bjornnorgaard commented 6 months ago

Check for existing bug reports before submitting.

Expected Behavior

Players created via inline statblock should only be added to a new encounter once when "Start Encounter" is clicked via rendered encounter block.

Current behaviour

If players are created in separate files as an inline statblock. Initiative Tracker will correctly register them as players. But will keep adding duplicate players to the same encounter each time "Start Encounter" is clicked.

See added gif for demonstration.

Obsidian_lbZfEuO2zB

Reproduction

Steps to reproduce

  1. Open sandbox vault.
  2. Install and enable plugins: Fantasy Statblock and Initiative Tracker.
  3. Paste the markdown below into a new file.
  4. Run command: Fantasy Statblock: Parse Frontmatter for Creatures.
  5. Start encounter with sword button in encounter block.
  6. Click the same button again.

Now multiple duplicate players have been added to the encounter.

Copy and paste the markdown below (view raw needed)


statblock: inline

Player Statblock

player: true
source: "Homebrew"
name: "Protagonist"
size: "Medium"
level: 1
ac: 15
hp: 20
speed: "30ft"
stats: [17, 14, 16, 6, 9, 14]

Encounter Section

players:
  - Protagonist
creatures:
  - Goblin

Which Operating Systems are you using?

Obsidian Version Check

1.5.8

Plugin Version

Fantasy Statblock 12.5.0 and Initiative Tracker 3.19.3

Confirmation

Possible solution

No response