mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[Fix] Party And Effect Minifixes (#1337)
* . * Added migration to remove ghosts from the TagTeamDialog
This commit is contained in:
parent
d616ddc113
commit
44b805d0df
6 changed files with 55 additions and 2 deletions
|
|
@ -191,6 +191,25 @@ export async function runMigrations() {
|
|||
|
||||
lastMigrationVersion = '1.2.0';
|
||||
}
|
||||
|
||||
if (foundry.utils.isNewerVersion('1.2.7', lastMigrationVersion)) {
|
||||
const tagTeam = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.TagTeamRoll);
|
||||
const initatorMissing = tagTeam.initiator && !game.actors.some(actor => actor.id === tagTeam.initiator);
|
||||
const missingMembers = Object.keys(tagTeam.members).reduce((acc, id) => {
|
||||
if (!game.actors.some(actor => actor.id === id)) {
|
||||
acc[`-=${id}`] = null;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
await tagTeam.updateSource({
|
||||
initiator: initatorMissing ? null : tagTeam.initiator,
|
||||
members: missingMembers
|
||||
});
|
||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.TagTeamRoll, tagTeam);
|
||||
|
||||
lastMigrationVersion = '1.2.7';
|
||||
}
|
||||
//#endregion
|
||||
|
||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue