refactor: force unconditional update of Ikonis weapon features to ensure ID and effect synchronization

This commit is contained in:
CPTN Cosmo 2026-04-26 20:04:45 +02:00
parent ff65ee50f8
commit bbe8da130e

View file

@ -50,11 +50,7 @@ export async function seedIkonisHomebrew() {
const nativeId = `ikonis-${aug.id}`; const nativeId = `ikonis-${aug.id}`;
const existing = homebrew.itemFeatures.weaponFeatures[nativeId]; const existing = homebrew.itemFeatures.weaponFeatures[nativeId];
// We update if it's missing OR if it's an Ikonis feature that needs an update (like Bonded getting effects) // Force update to ensure 16-character IDs and correct mechanical effects are synced
const hasEffects = aug.effects && aug.effects.length > 0;
const needsUpdate = !existing || (hasEffects && (!existing.effects || existing.effects.length === 0));
if (needsUpdate) {
console.log(`DH-Ikonis | Seeding/Updating feature: ${aug.name}`); console.log(`DH-Ikonis | Seeding/Updating feature: ${aug.name}`);
homebrew.itemFeatures.weaponFeatures[nativeId] = { homebrew.itemFeatures.weaponFeatures[nativeId] = {
name: `Ikonis: ${aug.name}`, name: `Ikonis: ${aug.name}`,
@ -65,7 +61,6 @@ export async function seedIkonisHomebrew() {
}; };
updates = true; updates = true;
} }
}
if (updates) { if (updates) {
await game.settings.set('daggerheart', homebrewKey, homebrew); await game.settings.set('daggerheart', homebrewKey, homebrew);