Fixed actions erroring with undefined resources

This commit is contained in:
Stefan Zermatten
2023-08-24 12:19:55 +02:00
parent 90c92cdd8c
commit 0ee77d705a

View File

@@ -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({