mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 04:01:06 +01:00
Tmp fix for non consistent resource
This commit is contained in:
parent
c5c98d7a99
commit
0cd3e41fa4
2 changed files with 3 additions and 2 deletions
|
|
@ -422,13 +422,14 @@ export default class DhpActor extends Actor {
|
|||
break;
|
||||
default:
|
||||
updates.actor.resources[`system.resources.${r.type}.value`] = Math.max(
|
||||
Math.min(this.system.resources[r.type].value + r.value, this.system.resources[r.type].max),
|
||||
Math.min(this.system.resources[r.type].value + r.value, (this.system.resources[r.type].maxTotal ?? this.system.resources[r.type].max)),
|
||||
0
|
||||
);
|
||||
break;
|
||||
}
|
||||
});
|
||||
Object.values(updates).forEach(async u => {
|
||||
console.log(updates, u)
|
||||
if (Object.keys(u.resources).length > 0) {
|
||||
if (game.user.isGM) {
|
||||
await u.target.update(u.resources);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue