mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Fixed crash on experience selection. Fixed subclass error on multiclassing
This commit is contained in:
parent
080b6bc2da
commit
908bc25579
3 changed files with 5 additions and 4 deletions
|
|
@ -51,7 +51,7 @@ export default class DhCharacterLevelUp extends LevelUpBase {
|
||||||
.filter(exp => exp.data.length > 0)
|
.filter(exp => exp.data.length > 0)
|
||||||
.flatMap(exp =>
|
.flatMap(exp =>
|
||||||
exp.data.map(data => {
|
exp.data.map(data => {
|
||||||
const experience = Object.keys(this.actor.system.experiences).find(x => x === data);
|
const experience = Object.keys(this.actor.system.experiences)[data];
|
||||||
return this.actor.system.experiences[experience].name;
|
return this.actor.system.experiences[experience].name;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ export default class DhCompanionLevelUp extends BaseLevelUp {
|
||||||
.filter(exp => exp.data.length > 0)
|
.filter(exp => exp.data.length > 0)
|
||||||
.flatMap(exp =>
|
.flatMap(exp =>
|
||||||
exp.data.map(data => {
|
exp.data.map(data => {
|
||||||
const experience = Object.keys(this.actor.system.experiences).find(x => x === data);
|
const experience = Object.keys(this.actor.system.experiences)[data];
|
||||||
return this.actor.system.experiences[experience].name;
|
return this.actor.system.experiences[experience].name;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ export default class DHSubclass extends BaseDataItem {
|
||||||
integer: false,
|
integer: false,
|
||||||
nullable: true,
|
nullable: true,
|
||||||
initial: null,
|
initial: null,
|
||||||
label: "DAGGERHEART.ITEMS.Subclass.spellcastingTrait"
|
label: 'DAGGERHEART.ITEMS.Subclass.spellcastingTrait'
|
||||||
}),
|
}),
|
||||||
features: new ItemLinkFields(),
|
features: new ItemLinkFields(),
|
||||||
featureState: new fields.NumberField({ required: true, initial: 1, min: 1 }),
|
featureState: new fields.NumberField({ required: true, initial: 1, min: 1 }),
|
||||||
|
|
@ -50,7 +50,8 @@ 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 = data.uuid ?? data._stats?.compendiumSource ?? `Item.${data._id}`;
|
const dataUuid =
|
||||||
|
data.uuid ?? data._stats?.compendiumSource ?? `Compendium.daggerheart.subclasses.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'));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue