From a7ad120929d26f0e360200eed2bf3a31e599d50c Mon Sep 17 00:00:00 2001 From: theripper93 Date: Mon, 19 Jul 2021 17:46:57 +0200 Subject: [PATCH] fix --- scripts/BloodSplatter.js | 6 +++++- splatter.lock | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 splatter.lock 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