Corrections

This commit is contained in:
WBHarry 2026-07-11 23:54:16 +02:00
parent 562e67f7bf
commit 17c09c76b0

View file

@ -334,24 +334,25 @@ export async function runMigrations() {
const batch = []; const batch = [];
for (const actor of game.actors) { for (const actor of game.actors) {
const updates = [];
for (const item of actor.items) { for (const item of actor.items) {
const updates = [];
for (const effect of item.effects) { for (const effect of item.effects) {
const changes = handler.updateEffect(effect.toObject(), effect.parent); const update = await handler.updateEffect(effect.toObject(), effect.parent);
if (changes) updates.push(changes); if (update) {
updates.push(update);
}
} }
if (updates.length) { if (updates.length) {
batch.push({ batch.push({ item, updates });
action: 'update',
documentName: 'ActiveEffect',
updates: [updates],
parent: item
});
} }
} }
} }
await foundry.documents.modifyBatch(batch); for (const updateData of batch) {
await updateData.item.updateEmbeddedDocuments('ActiveEffect', updateData.updates);
}
progress.advance({ by: 5 }); progress.advance({ by: 5 });
lastMigrationVersion = '2.5.2'; lastMigrationVersion = '2.5.2';