From 0ee77d705affbc0b6ba44d1307322f7bc445548e Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Thu, 24 Aug 2023 12:19:55 +0200 Subject: [PATCH] Fixed actions erroring with undefined resources --- .../api/engine/actions/applyPropertyByType/applyAction.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyAction.js b/app/imports/api/engine/actions/applyPropertyByType/applyAction.js index 4847e91d..115d1998 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyAction.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyAction.js @@ -272,9 +272,10 @@ function spendResources(prop, actionContext) { recalculateCalculation(attConsumed.quantity, actionContext); if (!attConsumed.quantity?.value) return; + if (!attConsumed.variableName) return; let stat = actionContext.scope[attConsumed.variableName]; if (!stat) { - spendLog.push(stat.name + ': ' + ' not found'); + spendLog.push(attConsumed.variableName + ': ' + ' not found'); return; } damagePropertyWork({