diff --git a/scripts/BloodSplatter.js b/scripts/BloodSplatter.js index da181e9..7fcf032 100644 --- a/scripts/BloodSplatter.js +++ b/scripts/BloodSplatter.js @@ -215,6 +215,10 @@ Hooks.once("socketlib.ready", () => { }); Hooks.on("preUpdateActor", function (actor, updates) { + updates.oldHpVal = BloodSplatter.getHpVal(actor.data); +}); + +Hooks.on("updateActor", function (actor, updates) { if ( !game.settings.get("splatter", "enableBloodsplatter") || (game.settings.get("splatter", "onlyInCombat") && !game.combat?.started) @@ -224,7 +228,7 @@ Hooks.on("preUpdateActor", function (actor, updates) { ? canvas.tokens.get(actor.parent.id) : canvas.tokens.placeables.find((t) => t.actor.id == actor.id); const hpMax = BloodSplatter.getHpMax(actor.data); - const oldHpVal = BloodSplatter.getHpVal(actor.data); + const oldHpVal = updates.oldHpVal//BloodSplatter.getHpVal(actor.data); const hpVal = BloodSplatter.getHpVal(updates); const impactScale = (oldHpVal - hpVal) / hpMax + 0.7; if ( diff --git a/splatter.lock b/splatter.lock new file mode 100644 index 0000000..82ef623 --- /dev/null +++ b/splatter.lock @@ -0,0 +1 @@ +🔒 \ No newline at end of file