mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
.
This commit is contained in:
parent
5df1d908a9
commit
a9a6e8b1d9
1 changed files with 4 additions and 4 deletions
|
|
@ -129,7 +129,7 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
||||||
*/
|
*/
|
||||||
for (let listFeature of this.features) {
|
for (let listFeature of this.features) {
|
||||||
const feature = listFeature.item ?? listFeature;
|
const feature = listFeature.item ?? listFeature;
|
||||||
const docs = await this.actor.createEmbeddedDocuments('Item', [
|
const [doc] = await this.actor.createEmbeddedDocuments('Item', [
|
||||||
{
|
{
|
||||||
...feature,
|
...feature,
|
||||||
effects: feature.effects.map(x => x.toObject()),
|
effects: feature.effects.map(x => x.toObject()),
|
||||||
|
|
@ -148,10 +148,10 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
||||||
const action = new cls(
|
const action = new cls(
|
||||||
{
|
{
|
||||||
...oldAction.toObject(),
|
...oldAction.toObject(),
|
||||||
...cls.getSourceConfig(docs[0])
|
...cls.getSourceConfig(doc)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
parent: docs[0]
|
parent: doc
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -160,7 +160,7 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
await docs[0].updateSource({ 'system.actions': actions });
|
await doc.updateSource({ 'system.actions': actions });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue