From 9d46f9433818b12a0977e7bde13d388dc56f0568 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Tue, 27 Jan 2026 17:50:23 +0100 Subject: [PATCH] Expanded the existing _preCreate logic --- module/applications/sheets/actors/character.mjs | 10 ---------- module/data/item/domainCard.mjs | 4 +++- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index aa197bd4..4ecaeb06 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -978,16 +978,6 @@ export default class CharacterSheet extends DHBaseActorSheet { return super._onDropItem(event, item); } - // Handle domain card drops - - if (item.type === 'domainCard') { - const {available} = this.document.system.loadoutSlot; - if (!item?.system.inVault && !available && !item?.system.loadoutIgnore) { //Check if there's space in loadout and if the item ignores loadout limits - item?.update({ 'system.inVault': true }); //Add to vault if no space (not working as intended. updateSource instead of update?) - return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached')); //Notify user - } - } - if (item.type === 'beastform') { if (this.document.effects.find(x => x.type === 'beastform')) { return ui.notifications.warn( diff --git a/module/data/item/domainCard.mjs b/module/data/item/domainCard.mjs index 327dafce..9a14d45e 100644 --- a/module/data/item/domainCard.mjs +++ b/module/data/item/domainCard.mjs @@ -94,8 +94,10 @@ export default class DHDomainCard extends BaseDataItem { return false; } - if (!this.actor.system.loadoutSlot.available) { + if (!this.actor.system.loadoutSlot.available && !this.loadoutIgnore) { data.system.inVault = true; + await this.updateSource({ inVault: true }); + ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.loadoutMaxReached')); } } }