mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Merge branch 'fix/subclass-links' of https://github.com/Foundryborne/daggerheart into fix/subclass-links
This commit is contained in:
commit
482adabae4
2 changed files with 19 additions and 1 deletions
|
|
@ -37,5 +37,23 @@ export async function runMigrations() {
|
||||||
lastMigrationVersion = '1.1.0';
|
lastMigrationVersion = '1.1.0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (versionCompare(lastMigrationVersion, '1.1.1')) {
|
||||||
|
const compendiumClasses = [];
|
||||||
|
for (let pack of game.packs) {
|
||||||
|
const documents = await pack.getDocuments();
|
||||||
|
compendiumClasses.push(...documents.filter(x => x.type === 'class'));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let classVal of [...compendiumClasses, ...game.items]) {
|
||||||
|
if (classVal.type !== 'class') continue;
|
||||||
|
|
||||||
|
for (let subclass of classVal.system.subclasses) {
|
||||||
|
await subclass.update({ 'system.linkedClass': classVal.uuid });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lastMigrationVersion = '1.1.1';
|
||||||
|
}
|
||||||
|
|
||||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);
|
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "daggerheart",
|
"id": "daggerheart",
|
||||||
"title": "Daggerheart",
|
"title": "Daggerheart",
|
||||||
"description": "An unofficial implementation of the Daggerheart system",
|
"description": "An unofficial implementation of the Daggerheart system",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "13",
|
"minimum": "13",
|
||||||
"verified": "13.347",
|
"verified": "13.347",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue