Skip to content

Commit

Permalink
Fix for NaN
Browse files Browse the repository at this point in the history
- Also added check to prevent possible NaN
  • Loading branch information
ChasarooniZ committed Jun 26, 2024
1 parent 5e27163 commit cfa1928
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Hooks.once("ready", async function () {
) {
let color = COLORS.DEEPSKYBLUE;
if (game.settings.get(MODULE_ID, "target.player-color")) {
color = user.color;
color = user.color.css;
}
flashColor(token, color, getAnimationChanges("target", { token }));
}
Expand Down Expand Up @@ -101,10 +101,8 @@ function getAnimationChanges(situation, data) {
if (game.settings.get(MODULE_ID, "damage-heal.scale-on-%-hp")) {
result.duration =
getDurationMultiplier(
Math.abs(
data.status.dmgTaken / data.actor.system.attributes.hp.value
)
) * baseDuration;
Math.abs(data.status.dmgTaken / data.system.attributes.hp.value)
) * baseDuration ?? baseDuration;
}
break;
case "flash":
Expand Down

0 comments on commit cfa1928

Please sign in to comment.