From 82058eceb7050bf14c2a923f5ca0d510fd516823 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Thu, 20 Nov 2025 18:39:26 +0100 Subject: [PATCH] Ancestry and community is now reset when dragging in a new one --- module/applications/sheets/actors/character.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index 85267944..9ee82d7d 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -907,6 +907,14 @@ export default class CharacterSheet extends DHBaseActorSheet { itemData.system.inVault = true; } + const typesThatReplace = ['ancestry', 'community']; + if (typesThatReplace.includes(item.type)) { + await this.document.deleteEmbeddedDocuments( + 'Item', + this.document.items.filter(x => x.type === item.type).map(x => x.id) + ); + } + if (item.type === 'beastform') { if (this.document.effects.find(x => x.type === 'beastform')) { return ui.notifications.warn(