From 0bd91a80188b4d22ccdd59adc6627345b1bb2204 Mon Sep 17 00:00:00 2001 From: cosmo Date: Sun, 26 Apr 2026 18:06:16 +0200 Subject: [PATCH] update instantiation methods to use class-specific implementations for better model linking --- scripts/ikonis-data.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/ikonis-data.js b/scripts/ikonis-data.js index 5ee93f6..8c262bb 100644 --- a/scripts/ikonis-data.js +++ b/scripts/ikonis-data.js @@ -99,7 +99,7 @@ export function patchIkonisLogic() { // Clone the effect and set this actor as parent to ensure application const effectData = effect.toObject(); effectData.disabled = false; - const effectInstance = new ActiveEffect(effectData, { parent: this }); + const effectInstance = ActiveEffect.implementation.fromObject(effectData, { parent: this }); yield effectInstance; } } @@ -115,7 +115,7 @@ export function patchIkonisLogic() { const effectData = effect.toObject(); effectData.disabled = false; - const effectInstance = new ActiveEffect(effectData, { parent: this }); + const effectInstance = ActiveEffect.implementation.fromObject(effectData, { parent: this }); yield effectInstance; } } @@ -159,8 +159,8 @@ export function patchDhCharacter(DhCharacter) { if (bondedUuid) { const feature = _featureCache.get(bondedUuid) || fromUuidSync(bondedUuid); if (feature) { - // Clone with actor as parent so actions work - const featureClone = feature.clone({ parent: this.parent }, { keepId: true }); + // Use fromObject with parent to ensure all Action models link correctly + const featureClone = Item.implementation.fromObject(feature.toObject(), { parent: this.parent }); ikonisFeatures.push(featureClone); console.log(`DH-Ikonis | Resolved bonded feature: ${feature.name}`); } @@ -177,8 +177,8 @@ export function patchDhCharacter(DhCharacter) { const feature = _featureCache.get(aug.featureUuid) || fromUuidSync(aug.featureUuid); if (feature) { - // Clone with actor as parent so actions work - const featureClone = feature.clone({ parent: this.parent }, { keepId: true }); + // Use fromObject with parent to ensure all Action models link correctly + const featureClone = Item.implementation.fromObject(feature.toObject(), { parent: this.parent }); ikonisFeatures.push(featureClone); console.log(`DH-Ikonis | Resolved augment feature: ${feature.name}`); }