Fixed bug where children of rolls would be applied

This commit is contained in:
Stefan Zermatten
2022-04-09 15:02:44 +02:00
parent 4d5cb3ed50
commit cc24690a67

View File

@@ -6,9 +6,11 @@ import resolve, { toString } from '/imports/parser/resolve.js';
export default function applyRoll(node, {creature, targets, scope, log}){ export default function applyRoll(node, {creature, targets, scope, log}){
const prop = node.node; const prop = node.node;
const applyChildren = node.children.forEach(child => applyProperty(child, { const applyChildren = function(){
creature, targets, scope, log node.children.forEach(child => applyProperty(child, {
})); creature, targets, scope, log
}));
};
if (prop.roll?.calculation){ if (prop.roll?.calculation){
const logValue = []; const logValue = [];
@@ -54,7 +56,5 @@ export default function applyRoll(node, {creature, targets, scope, log}){
}); });
} }
} }
return node.children.forEach(child => applyProperty(child, { return applyChildren();
creature, targets, scope, log
}));
} }