update instantiation methods to use class-specific implementations for better model linking

This commit is contained in:
CPTN Cosmo 2026-04-26 18:06:16 +02:00
parent f2873c5c81
commit 0bd91a8018

View file

@ -99,7 +99,7 @@ export function patchIkonisLogic() {
// Clone the effect and set this actor as parent to ensure application // Clone the effect and set this actor as parent to ensure application
const effectData = effect.toObject(); const effectData = effect.toObject();
effectData.disabled = false; effectData.disabled = false;
const effectInstance = new ActiveEffect(effectData, { parent: this }); const effectInstance = ActiveEffect.implementation.fromObject(effectData, { parent: this });
yield effectInstance; yield effectInstance;
} }
} }
@ -115,7 +115,7 @@ export function patchIkonisLogic() {
const effectData = effect.toObject(); const effectData = effect.toObject();
effectData.disabled = false; effectData.disabled = false;
const effectInstance = new ActiveEffect(effectData, { parent: this }); const effectInstance = ActiveEffect.implementation.fromObject(effectData, { parent: this });
yield effectInstance; yield effectInstance;
} }
} }
@ -159,8 +159,8 @@ export function patchDhCharacter(DhCharacter) {
if (bondedUuid) { if (bondedUuid) {
const feature = _featureCache.get(bondedUuid) || fromUuidSync(bondedUuid); const feature = _featureCache.get(bondedUuid) || fromUuidSync(bondedUuid);
if (feature) { if (feature) {
// Clone with actor as parent so actions work // Use fromObject with parent to ensure all Action models link correctly
const featureClone = feature.clone({ parent: this.parent }, { keepId: true }); const featureClone = Item.implementation.fromObject(feature.toObject(), { parent: this.parent });
ikonisFeatures.push(featureClone); ikonisFeatures.push(featureClone);
console.log(`DH-Ikonis | Resolved bonded feature: ${feature.name}`); 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); const feature = _featureCache.get(aug.featureUuid) || fromUuidSync(aug.featureUuid);
if (feature) { if (feature) {
// Clone with actor as parent so actions work // Use fromObject with parent to ensure all Action models link correctly
const featureClone = feature.clone({ parent: this.parent }, { keepId: true }); const featureClone = Item.implementation.fromObject(feature.toObject(), { parent: this.parent });
ikonisFeatures.push(featureClone); ikonisFeatures.push(featureClone);
console.log(`DH-Ikonis | Resolved augment feature: ${feature.name}`); console.log(`DH-Ikonis | Resolved augment feature: ${feature.name}`);
} }