Open Trantion897 opened 2 months ago
This bug is caused because one of my characters (and the first one alphabetically, so the most likely to be included when I tested it) had all the frontmatter in the PC's note defined as text instead of numbers as they should be. Fixing the note fixes the issue, but I'm trying out a patch to add parseInt()
when reading the player's note to save anyone this trouble in future. It will only work when the note is parsed, so for existing characters you'll need to delete and recreate the character in the initiative tracker settings.
Check for existing bug reports before submitting.
Expected Behavior
Encounter XP should be non-zero (affects both inline encounter builder and side panel)
Current behaviour
Encounter XP is missing, summarised as "Trivial"
Reproduction
Which Operating Systems are you using?
Obsidian Version Check
1.6.7 and 1.5.3
Plugin Version
13.0.12
Confirmation
Possible solution
I debugged the plugin and found that the
playerLevels
parameter being passed togetCreatureDifficulty()
insrc/utils/rpg-system/pf2e.ts
is an array of strings, so line 89 concatenates instead of adding, so after dividing by the number of PCs we get an invalid array index forreturn XP_CREATURE_DIFFERENCES[creature_differences] ?? 0;
.I made a quick fix to get it working for me (only for Pathfinder), but I think the root cause will be a change that's caused the
playerLevels
to be an array of strings, because I think this worked some time before. I haven't looked into where that array is coming from, or which version introduced the issue. Therefore I'm considering this commit a proof of concept rather than a pull request, though I might be able to investigate more later on.