diff --git a/module/applications/ancestrySelectionDialog.mjs b/module/applications/ancestrySelectionDialog.mjs index 1ca15908..0cdb0dd9 100644 --- a/module/applications/ancestrySelectionDialog.mjs +++ b/module/applications/ancestrySelectionDialog.mjs @@ -65,7 +65,7 @@ export default class AncestrySelectionDialog extends HandlebarsApplicationMixin( } async _prepareContext(_options) { - const systemAncestries = Array.from((await game.packs.get('daggerheart.playtest-ancestries')).index).map(x => ({ + const systemAncestries = Array.from((await game.packs.get('daggerheart.ancestries')).index).map(x => ({ ...x, selected: this.data.ancestries.some(selected => selected.uuid === x.uuid) })); diff --git a/module/applications/deathMove.mjs b/module/applications/deathMove.mjs index 54622a1a..af4a0c9c 100644 --- a/module/applications/deathMove.mjs +++ b/module/applications/deathMove.mjs @@ -48,7 +48,7 @@ export default class DhpDeathMove extends HandlebarsApplicationMixin(Application const msg = new cls({ user: game.user.id, content: await renderTemplate('systems/daggerheart/templates/chat/deathMove.hbs', { - player: game.user.character.name, + player: this.actor.name, title: game.i18n.localize(this.selectedMove.name), img: this.selectedMove.img, description: game.i18n.localize(this.selectedMove.description) diff --git a/module/applications/downtime.mjs b/module/applications/downtime.mjs index 06575f80..f1da7678 100644 --- a/module/applications/downtime.mjs +++ b/module/applications/downtime.mjs @@ -71,7 +71,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV const msg = new cls({ user: game.user.id, content: await renderTemplate('systems/daggerheart/templates/chat/downtime.hbs', { - player: game.user.character.name, + player: this.actor.name, title: game.i18n.localize(this.selectedActivity.name), img: this.selectedActivity.img, description: game.i18n.localize(this.selectedActivity.description), diff --git a/module/applications/sheets/pc.mjs b/module/applications/sheets/pc.mjs index 53ac00d4..dc36ba06 100644 --- a/module/applications/sheets/pc.mjs +++ b/module/applications/sheets/pc.mjs @@ -659,11 +659,11 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) { } static async selectClass() { - (await game.packs.get('daggerheart.playtest-classes'))?.render(true); + (await game.packs.get('daggerheart.classes'))?.render(true); } static async selectSubclass() { - (await game.packs.get('daggerheart.playtest-subclasses'))?.render(true); + (await game.packs.get('daggerheart.subclasses'))?.render(true); } static async selectAncestry() { @@ -694,7 +694,7 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) { } static async selectCommunity() { - (await game.packs.get('daggerheart.playtest-communities'))?.render(true); + (await game.packs.get('daggerheart.communities'))?.render(true); } static async viewObject(_, button) { @@ -702,7 +702,7 @@ export default class PCSheet extends DaggerheartSheet(ActorSheetV2) { if (!object) return; const tab = button.dataset.tab; - if (tab) object.sheet._tabs[0].active = tab; + if (tab && object.sheet._tabs) object.sheet._tabs[0].active = tab; if (object.sheet.editMode) object.sheet.editMode = false; diff --git a/module/applications/sheets/subclass.mjs b/module/applications/sheets/subclass.mjs index f456aac2..40128ab0 100644 --- a/module/applications/sheets/subclass.mjs +++ b/module/applications/sheets/subclass.mjs @@ -183,7 +183,7 @@ export default class SubclassSheet extends DaggerheartSheet(ItemSheetV2) { } async _onDrop(event) { - event.preventDefault() + event.preventDefault(); const data = TextEditor.getDragEventData(event); const item = await fromUuid(data.uuid); if (!(item.type === 'feature' && item.system.type === SYSTEM.ITEM.featureTypes.subclass.id)) return; @@ -196,7 +196,7 @@ export default class SubclassSheet extends DaggerheartSheet(ItemSheetV2) { const path = `system.${featureField}Feature.abilities`; const abilities = duplicate(getProperty(this.document, path)) || []; - const featureData = {name: item.name, img: item.img, uuid: item.uuid }; + const featureData = { name: item.name, img: item.img, uuid: item.uuid }; abilities.push(featureData); await this.document.update({ [path]: abilities }); diff --git a/module/data/pc.mjs b/module/data/pc.mjs index b68f0a03..c7aa9660 100644 --- a/module/data/pc.mjs +++ b/module/data/pc.mjs @@ -337,7 +337,7 @@ export default class DhpPC extends foundry.abstract.TypeDataModel { get refreshableFeatures() { return this.parent.items.reduce( (acc, x) => { - if (x.type === 'feature' && x.system.refreshData.type) { + if (x.type === 'feature' && x.system.refreshData?.type) { acc[x.system.refreshData.type].push(x); } diff --git a/templates/sheets/pc/sections/loadout.hbs b/templates/sheets/pc/sections/loadout.hbs index 516a9411..62d76d1e 100644 --- a/templates/sheets/pc/sections/loadout.hbs +++ b/templates/sheets/pc/sections/loadout.hbs @@ -1,8 +1,11 @@