Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Jul 19, 2021
1 parent 6914fb6 commit a7ad120
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/BloodSplatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 (
Expand Down
1 change: 1 addition & 0 deletions splatter.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
🔒

0 comments on commit a7ad120

Please sign in to comment.