From 545050cfa3d1f77de886b4e6f64e8939623de61d Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Fri, 4 Mar 2022 16:09:00 +0200 Subject: [PATCH] Fixed attack disadvantage being treated as advantage --- .../api/engine/actions/applyPropertyByType/applyAction.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyAction.js b/app/imports/api/engine/actions/applyPropertyByType/applyAction.js index a92255c1..7b3b3a2e 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyAction.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyAction.js @@ -127,7 +127,7 @@ function applyAttackToTarget({attack, target, scope, log}){ function rollAttack(attack, scope){ const rollModifierText = numberToSignedString(attack.value, true); let value, resultPrefix; - if (attack.advantage === 1 || scope['$attackAdvantage']){ + if (scope['$attackAdvantage'] === 1){ const [a, b] = rollDice(2, 20); if (a >= b) { value = a; @@ -136,7 +136,7 @@ function rollAttack(attack, scope){ value = b; resultPrefix = `1d20 [ ~~${a}~~, ${b} ] ${rollModifierText}`; } - } else if (attack.advantage === -1 || scope['$attackDisadvantage']){ + } else if (scope['$attackAdvantage'] === -1){ const [a, b] = rollDice(2, 20); if (a <= b) { value = a;