From cc24690a67db08b803d73c7c412b75c6a1e14b32 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Sat, 9 Apr 2022 15:02:44 +0200 Subject: [PATCH] Fixed bug where children of rolls would be applied --- .../engine/actions/applyPropertyByType/applyRoll.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js b/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js index a097f977..8d923e4e 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js @@ -6,9 +6,11 @@ import resolve, { toString } from '/imports/parser/resolve.js'; export default function applyRoll(node, {creature, targets, scope, log}){ const prop = node.node; - const applyChildren = node.children.forEach(child => applyProperty(child, { - creature, targets, scope, log - })); + const applyChildren = function(){ + node.children.forEach(child => applyProperty(child, { + creature, targets, scope, log + })); + }; if (prop.roll?.calculation){ const logValue = []; @@ -54,7 +56,5 @@ export default function applyRoll(node, {creature, targets, scope, log}){ }); } } - return node.children.forEach(child => applyProperty(child, { - creature, targets, scope, log - })); + return applyChildren(); }