mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
Fixed parsing of resource.max
This commit is contained in:
parent
9fc1005caa
commit
de4267ff3c
6 changed files with 36 additions and 51 deletions
|
|
@ -500,9 +500,8 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
const item = this.getItem(event.currentTarget);
|
||||
if (!item) return;
|
||||
|
||||
const value = item.system.resource.max
|
||||
? Math.min(Number(event.currentTarget.value), item.system.resource.max)
|
||||
: event.currentTarget.value;
|
||||
const max = item.system.resource.max ? Roll.replaceFormulaData(item.system.resource.max, this.document) : null;
|
||||
const value = max ? Math.min(Number(event.currentTarget.value), max) : event.currentTarget.value;
|
||||
await item.update({ 'system.resource.value': value });
|
||||
this.render();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue