level sync fixes

This commit is contained in:
WBHarry 2025-06-30 14:12:36 +02:00
parent 29c6cc60c3
commit 3333a9e00a
2 changed files with 6 additions and 1 deletions

View file

@ -51,8 +51,8 @@ export default class DhCompanionSheet extends DaggerheartSheet(ActorSheetV2) {
}
async onPartnerChange(event) {
const partner = game.actors.find(a => a.uuid === event.target.value);
if (event.target.value) {
const partner = game.actors.find(a => a.uuid === event.target.value);
await partner.update({ 'system.companion': this.document.uuid });
} else {
const update = { 'system.companion': null };
@ -74,6 +74,7 @@ export default class DhCompanionSheet extends DaggerheartSheet(ActorSheetV2) {
}
await this.document.update({ 'system.partner': event.target.value });
await this.document.updateLevel(partner ? partner.system.levelData.level.current : 1);
}
static async attackRoll(event) {