mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Fixed deletion of characters in the world locking up the party actor
This commit is contained in:
parent
63e66bd0d3
commit
013085299f
5 changed files with 36 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ export async function runMigrations() {
|
|||
let lastMigrationVersion = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion);
|
||||
if (!lastMigrationVersion) lastMigrationVersion = game.system.version;
|
||||
|
||||
//#region old migrations
|
||||
if (foundry.utils.isNewerVersion('1.1.0', lastMigrationVersion)) {
|
||||
const lockedPacks = [];
|
||||
const compendiumActors = [];
|
||||
|
|
@ -190,6 +191,16 @@ export async function runMigrations() {
|
|||
|
||||
lastMigrationVersion = '1.2.0';
|
||||
}
|
||||
//#endregion
|
||||
|
||||
if (foundry.utils.isNewerVersion('1.2.2', lastMigrationVersion)) {
|
||||
/* Delete any null party members caused by characters being deleted in the world prior to it being handled */
|
||||
for (let party of game.actors.filter(x => x.type === 'party')) {
|
||||
await party.update({ 'system.partyMembers': party.system.partyMembers.filter(x => x) });
|
||||
}
|
||||
|
||||
lastMigrationVersion = '1.2.2';
|
||||
}
|
||||
|
||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue