diff --git a/module/actor.js b/module/actor.js index 0823b8d..7b30cea 100644 --- a/module/actor.js +++ b/module/actor.js @@ -256,7 +256,7 @@ export class SimpleActor extends Actor { if ( !isBar || !isDelta || (current?.dtype !== "Resource") ) { return super.modifyTokenAttribute(attribute, value, isDelta, isBar); } - const updates = {[`system.${attribute}.value`]: Math.clamped(current.value + value, current.min, current.max)}; + const updates = {[`system.${attribute}.value`]: Math.clamp(current.value + value, current.min, current.max)}; const allowed = Hooks.call("modifyTokenAttribute", {attribute, value, isDelta, isBar}, updates); return allowed !== false ? this.update(updates) : this; } diff --git a/module/helper.js b/module/helper.js index e01438b..c9f0bf1 100644 --- a/module/helper.js +++ b/module/helper.js @@ -583,7 +583,7 @@ export class EntitySheetHelper { if ( parts.pop() !== "value" ) continue; const current = foundry.utils.getProperty(attrs, parts.join(".")); if ( current?.dtype !== "Resource" ) continue; - foundry.utils.setProperty(attrs, attr, Math.clamped(value, current.min || 0, current.max || 0)); + foundry.utils.setProperty(attrs, attr, Math.clamp(value, current.min || 0, current.max || 0)); } }