Fix issues with companions

This commit is contained in:
Carlos Fernandez 2026-04-25 23:29:29 -04:00
parent 6d09c5504d
commit 899f286def
6 changed files with 25 additions and 13 deletions

View file

@ -145,7 +145,7 @@ export default class DhCompanion extends DhCreature {
for (let selection of level.selections) {
switch (selection.type) {
case 'hope':
this.resources.hope += selection.value;
this.resources.hope.max += selection.value;
break;
case 'vicious':
if (selection.data[0] === 'damage') {
@ -183,6 +183,9 @@ export default class DhCompanion extends DhCreature {
return acc;
}, this.partner.system.companionData.levelupChoices);
}
// Clamp resources (must be done last to ensure all updates occur)
this.resources.clamp();
}
async _preUpdate(changes, options, userId) {