mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +02:00
Fixed character creation
This commit is contained in:
parent
05167b697a
commit
533421abba
3 changed files with 6 additions and 4 deletions
|
|
@ -441,7 +441,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
||||||
|
|
||||||
if (type === 'subclasses')
|
if (type === 'subclasses')
|
||||||
presets.filter = {
|
presets.filter = {
|
||||||
'system.linkedClass.uuid': { key: 'system.linkedClass.uuid', value: this.setup.class?.uuid }
|
'system.linkedClass': { key: 'system.linkedClass', value: this.setup.class?.uuid }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (equipment.includes(type))
|
if (equipment.includes(type))
|
||||||
|
|
@ -610,7 +610,8 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
||||||
[foundry.utils.randomID()]: {}
|
[foundry.utils.randomID()]: {}
|
||||||
};
|
};
|
||||||
} else if (item.type === 'subclass' && event.target.closest('.subclass-card')) {
|
} else if (item.type === 'subclass' && event.target.closest('.subclass-card')) {
|
||||||
if (this.setup.class.system.subclasses.every(subclass => subclass.uuid !== item.uuid)) {
|
const classSubclasses = await this.setup.class.system.fetchSubclasses();
|
||||||
|
if (classSubclasses.every(subclass => subclass.uuid !== item.uuid)) {
|
||||||
ui.notifications.error(game.i18n.localize('DAGGERHEART.UI.Notifications.subclassNotInClass'));
|
ui.notifications.error(game.i18n.localize('DAGGERHEART.UI.Notifications.subclassNotInClass'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
||||||
const features = [];
|
const features = [];
|
||||||
for (let f of this.features) {
|
for (let f of this.features) {
|
||||||
const fBase = f.item ?? f;
|
const fBase = f.item ?? f;
|
||||||
const feature = fBase.system ? fBase : await foundry.utils.fromUuid(fBase.uuid);
|
const feature = fBase.pack ? await foundry.utils.fromUuid(fBase.uuid) : fBase;
|
||||||
features.push(
|
features.push(
|
||||||
foundry.utils.mergeObject(
|
foundry.utils.mergeObject(
|
||||||
feature.toObject(),
|
feature.toObject(),
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,8 @@ export default class DHSubclass extends BaseDataItem {
|
||||||
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.missingClass'));
|
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.missingClass'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (actorClass.system.subclasses.every(x => x.uuid !== dataUuid)) {
|
|
||||||
|
if ((await actorClass.system.fetchSubclasses()).every(x => x.uuid !== dataUuid)) {
|
||||||
ui.notifications.error(game.i18n.localize('DAGGERHEART.UI.Notifications.subclassNotInClass'));
|
ui.notifications.error(game.i18n.localize('DAGGERHEART.UI.Notifications.subclassNotInClass'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue