obsidian-initiative-tracker
obsidian-initiative-tracker copied to clipboard
BUG: Strings in the level field causes difficulty calculation to crash
Check for existing bug reports before submitting.
- [X] I searched for existing Bug Reports and found no similar reports.
Expected Behavior
When I have a encounter with:
players: true
The players should be added.
Current behaviour
When the statblock includes the players, I get an error in the console:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'easy')
at eval (plugin:initiative-tracker:6851:55)
at Array.reduce (<anonymous>)
at eval (plugin:initiative-tracker:6850:36)
at Array.forEach (<anonymous>)
at Dnd5eRpgSystem.getDifficultyThresholds (plugin:initiative-tracker:6849:25)
at Dnd5eRpgSystem.getEncounterDifficulty (plugin:initiative-tracker:6823:29)
at eval (plugin:initiative-tracker:14001:31)
at sync (plugin:initiative-tracker:10465:22)
at Array.eval (plugin:initiative-tracker:10476:9)
at set (plugin:initiative-tracker:10424:35)
Reproduction
Have a few players defined, and make a simple encounter, i.e.
name: Test
players: true
creatures:
- 1: Goblin
Disabling "Display encounter difficulty" makes no difference.
Which Operating Systems are you using?
- [ ] Android
- [ ] iPhone/iPad
- [X] Linux
- [ ] macOS
- [ ] Windows
Obsidian Version Check
1.3.7 and 1.3.7
Plugin Version
12.1.0
Confirmation
- [ ] I have disabled all other plugins and the issue still persists.
Possible solution
No response
Issue was that I took over the "class & level" from the statsheet for the level, so I had in the statblock:
level: "Figher 1"
for example. Changing it to numbers caused it to work again as expected.
@MidasLamb thanks I’ll keep this open because the difficulty systems should handle this