Ancestry and community is now reset when dragging in a new one (#1315)

This commit is contained in:
WBHarry 2025-11-23 15:19:30 +01:00 committed by GitHub
parent ebf98a6ae5
commit 6398ba15f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -911,6 +911,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(