Fixed so subclasses can be dragged to the sheet when they're stored in a folder

This commit is contained in:
WBHarry 2025-08-24 22:37:09 +02:00
parent f480027b95
commit 72d183f059

View file

@ -52,8 +52,7 @@ export default class DHSubclass extends BaseDataItem {
async _preCreate(data, options, user) { async _preCreate(data, options, user) {
if (this.actor?.type === 'character') { if (this.actor?.type === 'character') {
const dataUuid = const dataUuid = data.uuid ?? data._stats.compendiumSource ?? `Item.${data._id}`;
data.uuid ?? (data.folder ? `Compendium.daggerheart.subclasses.Item.${data._id}` : `Item.${data._id}`);
if (this.actor.system.class.subclass) { if (this.actor.system.class.subclass) {
if (this.actor.system.multiclass.subclass) { if (this.actor.system.multiclass.subclass) {
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.subclassesAlreadyPresent')); ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.subclassesAlreadyPresent'));