Fixed scars change preUpdate

This commit is contained in:
WBHarry 2026-03-12 19:52:01 +01:00
parent 4282933dcf
commit 50b4b4cf26

View file

@ -721,7 +721,8 @@ export default class DhCharacter extends DhCreature {
const newHopeMax = this.system.resources.hope.max + diff;
const newHopeValue = Math.min(newHopeMax, this.system.resources.hope.value);
if (newHopeValue != this.system.resources.hope.value) {
if (!changes.system.resources) changes.system.resources = { hope: { value: 0 } };
if (!changes.system.resources.hope) changes.system.resources.hope = { value: 0 };
changes.system.resources.hope = {
...changes.system.resources.hope,
value: changes.system.resources.hope.value + newHopeValue