mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 10:29:54 +02:00
Corrections
This commit is contained in:
parent
562e67f7bf
commit
17c09c76b0
1 changed files with 11 additions and 10 deletions
|
|
@ -334,24 +334,25 @@ export async function runMigrations() {
|
|||
|
||||
const batch = [];
|
||||
for (const actor of game.actors) {
|
||||
const updates = [];
|
||||
for (const item of actor.items) {
|
||||
const updates = [];
|
||||
for (const effect of item.effects) {
|
||||
const changes = handler.updateEffect(effect.toObject(), effect.parent);
|
||||
if (changes) updates.push(changes);
|
||||
const update = await handler.updateEffect(effect.toObject(), effect.parent);
|
||||
if (update) {
|
||||
updates.push(update);
|
||||
}
|
||||
}
|
||||
|
||||
if (updates.length) {
|
||||
batch.push({
|
||||
action: 'update',
|
||||
documentName: 'ActiveEffect',
|
||||
updates: [updates],
|
||||
parent: item
|
||||
});
|
||||
batch.push({ item, updates });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await foundry.documents.modifyBatch(batch);
|
||||
for (const updateData of batch) {
|
||||
await updateData.item.updateEmbeddedDocuments('ActiveEffect', updateData.updates);
|
||||
}
|
||||
|
||||
progress.advance({ by: 5 });
|
||||
|
||||
lastMigrationVersion = '2.5.2';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue