Fixed some bugs with characters not recomputing
TODO: remove .variables cache from creature document, it's not viable
This commit is contained in:
@@ -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 &&
|
||||
|
||||
@@ -79,7 +79,7 @@ const doAction = new ValidatedMethod({
|
||||
Creatures.update({
|
||||
_id: { $in: [creature._id, ...targetIds] }
|
||||
}, {
|
||||
dirty: true
|
||||
$set: {dirty: true},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -133,7 +133,7 @@ const doAction = new ValidatedMethod({
|
||||
Creatures.update({
|
||||
_id: { $in: [creature._id, ...targetIds] }
|
||||
}, {
|
||||
dirty: true
|
||||
$set: { dirty: true },
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user