From 9850d5f6e8ef6ffeb6f15e2bca4284ebbaea00b8 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Tue, 1 Jul 2025 03:43:15 +0200 Subject: [PATCH] Restored delevel on partner removal --- module/applications/sheets/companion.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/applications/sheets/companion.mjs b/module/applications/sheets/companion.mjs index 1a0eb9f7..694a12f6 100644 --- a/module/applications/sheets/companion.mjs +++ b/module/applications/sheets/companion.mjs @@ -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,10 @@ export default class DhCompanionSheet extends DaggerheartSheet(ActorSheetV2) { } await this.document.update({ 'system.partner': event.target.value }); + + if (!partner) { + await this.document.updateLevel(1); + } } static async attackRoll(event) {