mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 02:19: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 = [];
|
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';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue