This commit is contained in:
WBHarry 2025-07-29 22:58:09 +02:00
parent 5df1d908a9
commit a9a6e8b1d9

View file

@ -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 });
} }
} }
} }