Added ActiveEffects to Beastbound features

This commit is contained in:
WBHarry 2026-01-19 22:42:43 +01:00
parent bd5ef8e8d7
commit 0660939cec
5 changed files with 108 additions and 13 deletions

View file

@ -725,17 +725,14 @@ export default class DhCharacter extends BaseDataActor {
};
}
}
}
_onUpdate(changes, options, userId) {
super._onUpdate(changes, options, userId);
if (game.user.id === userId) {
/* Companion updates */
if (this.companion) {
if (changes.system.levelData?.level?.current !== undefined) {
this.companion.update(this.companion.toObject(), { diff: false, recursive: false });
}
/* Force companion data prep */
if (this.companion) {
if (
changes.system?.levelData?.level?.current !== undefined &&
changes.system.levelData.level.current !== this._source.levelData.level.current
) {
this.companion.update(this.companion.toObject(), { diff: false, recursive: false });
}
}
}

View file

@ -177,6 +177,16 @@ export default class DhCompanion extends BaseDataActor {
changes.system.experiences[experience].core = true;
}
}
/* Force partner data prep */
if (this.partner) {
if (
changes.system?.levelData?.level?.current !== undefined &&
changes.system.levelData.level.current !== this._source.levelData.level.current
) {
this.partner.update(this.partner.toObject(), { diff: false, recursive: false });
}
}
}
async _preDelete() {