More fixes

This commit is contained in:
WBHarry 2025-07-16 00:53:58 +02:00
parent 701a69a9c1
commit d65c0f91fc
4 changed files with 15 additions and 11 deletions

View file

@ -407,7 +407,8 @@ export default class DhCharacter extends BaseDataActor {
}
prepareDerivedData() {
this.resources.hope.value = Math.min(this.resources.hope.value, this.resources.hope.max);
const baseHope = this.resources.hope.value + (this.companion?.system?.resources?.hope ?? 0);
this.resources.hope.value = Math.min(baseHope, this.resources.hope.max);
}
getRollData() {

View file

@ -124,12 +124,6 @@ export default class DhCompanion extends BaseDataActor {
}
}
prepareDerivedData() {
if (this.partner) {
this.partner.system.resources.hope.max += this.resources.hope;
}
}
async _preDelete() {
if (this.partner) {
await this.partner.update({ 'system.companion': null });