Skip to content

Commit

Permalink
Native rolls: Don't include custom damage type if empty
Browse files Browse the repository at this point in the history
When building damage formula, don't add the damage type if it's empty, otherwise it created `[]` which causes Foundry to crash.
(untested)
Fixes #1086
  • Loading branch information
kakaroto authored Nov 5, 2023
1 parent da121a4 commit ab609f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion FVTT-module/beyond20/beyond20.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class Beyond20 {
for (let i = 0; i < request.damages.length; i++) {
let type = (request['damage-types'][i] || "").trim();
// Add damage type in the flavor text for each damage
const damage = `(${request.damages[i]})[${type}]`;
const damage = type ? `(${request.damages[i]})[${type}]` : `${request.damages[i]}`;
if (CONFIG.DND5E.damageTypes[type.toLowerCase()]) {
type = type.toLowerCase();
} else {
Expand Down

0 comments on commit ab609f1

Please sign in to comment.