* Fixes

* Remove comment
This commit is contained in:
Dapoulp 2025-08-10 01:23:00 +02:00 committed by GitHub
parent 7faec34597
commit 2aaab73699
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 87 additions and 53 deletions

View file

@ -644,16 +644,20 @@ export default class DhpActor extends Actor {
);
break;
case 'armor':
updates.armor.resources['system.marks.value'] = Math.max(
Math.min(this.system.armor.system.marks.value + r.value, this.system.armorScore),
0
);
if(this.system.armor?.system?.marks) {
updates.armor.resources['system.marks.value'] = Math.max(
Math.min(this.system.armor.system.marks.value + r.value, this.system.armorScore),
0
);
}
break;
default:
updates.actor.resources[`system.resources.${r.key}.value`] = Math.max(
Math.min(this.system.resources[r.key].value + r.value, this.system.resources[r.key].max),
0
);
if(this.system.resources?.[r.key]) {
updates.actor.resources[`system.resources.${r.key}.value`] = Math.max(
Math.min(this.system.resources[r.key].value + r.value, this.system.resources[r.key].max),
0
);
}
break;
}
}