Fixed some bugs with characters not recomputing

TODO: remove .variables cache from creature document, it's not viable
This commit is contained in:
Stefan Zermatten
2022-06-23 08:39:48 +02:00
parent b484a27637
commit b2f89eceee
6 changed files with 17 additions and 7 deletions

View File

@@ -18,10 +18,9 @@ export default function applyDamage(node, {
const prop = node.node;
// Skip if there is no parse node to work with
if (!prop.amount.parseNode) return;
if (!prop.amount?.parseNode) return;
// Choose target
let damageTargets = prop.target === 'self' ? [creature] : targets;
// Determine if the hit is critical
let criticalHit = scope['$criticalHit']?.value &&

View File

@@ -79,7 +79,7 @@ const doAction = new ValidatedMethod({
Creatures.update({
_id: { $in: [creature._id, ...targetIds] }
}, {
dirty: true
$set: {dirty: true},
});
},
});

View File

@@ -133,7 +133,7 @@ const doAction = new ValidatedMethod({
Creatures.update({
_id: { $in: [creature._id, ...targetIds] }
}, {
dirty: true
$set: { dirty: true },
});
},
});