-
-
Notifications
You must be signed in to change notification settings - Fork 54
Description
Check for existing bug reports before submitting.
- I searched for existing Bug Reports and found no similar reports.
Expected Behavior
This is an interaction between Fantasy Statblocks pathbuilder importer and this plugin, I wasn't sure which one to submit the report to but this is where the issue becomes visible so hopefully that's alright.
When I launch an encounter with characters imported from pathbuilder2e data, all of the party members are duplicated. I traced the code and found that the pathbuilder2e data doesn't include an id field, which I think causes Creature.from to use a freshly-generated one each time (Link to the line is below). Since the encounter creatures are filtered down by reinserting into a map keyed by id at tracker/stores/tracker.ts:785, the player characters get inserted again each time the encounter is launched.
| ].map((c) => [c.id, c]) |
initiative-tracker/src/utils/creature.ts
Line 189 in f501053
| return new Creature({ |
Current behaviour
Player characters are added multiple times when launching encounters if the source data doesn't include an id
Reproduction
- Create a character on pathbuilder2e.com
- Download the JSON data
- Import the character from the Fantasy Statblocks > Import Pathbuilder Data option
- Add the character to a party and make the party default
- Launch an encounter.
- Launch another encounter. The party will be duplicated in the encounter.
Which Operating Systems are you using?
- Android
- iPhone/iPad
- Linux
- macOS
- Windows
Obsidian Version Check
1.8.10
Plugin Version
13.0.17
Confirmation
- I have disabled all other plugins and the issue still persists.
Possible solution
I think the solution is probably to explicitly create a unique id in the Fantasty Statblocks pathbuilder2e importer, maybe by hashing the character data or absolute path to the JSON file or something? Alternatively, maybe add a field to the party builder to ask the user for a unique id like the form for a standard character does.
Here's an example of the character JSON from pathbuilder for convenience: circe-cailleach.json