From 94cdca4f31efdbb2648aaf861eb0d616804f91d1 Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Mon, 28 Feb 2022 16:25:42 +0200 Subject: [PATCH] Fixed uses left not logging correctly in actions --- .../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 d8daf1d1..6f9a413e 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyAction.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyAction.js @@ -178,7 +178,7 @@ function applyChildren(node, args){ function spendResources({prop, log, scope}){ // Check Uses - if (prop.usesLeft < 0){ + if (prop.usesLeft <= 0){ log.content.push({ name: 'Error', value: `${prop.name || 'action'} does not have enough uses left`, @@ -250,7 +250,7 @@ function spendResources({prop, log, scope}){ }); log.content.push({ name: 'Uses left', - value: prop.usesLeft - (prop.usesUsed || 0) - 1, + value: prop.usesLeft - 1, }); }