fix : Prepare values are sometimes null, and default do nothing for it

This commit is contained in:
Vlyan
2023-03-23 09:34:40 +01:00
parent 1b68d33bd2
commit c1bf9644f8

View File

@@ -28,6 +28,14 @@ export default class HooksL5r5e {
game.l5r5e.migrations.migrateWorld({ force: false }).then();
}
// Prepare values are sometimes null
["character", "adversary", "minion"].forEach(preparedId => {
const prepVal = game.settings.get(CONFIG.l5r5e.systemName, `initiative-prepared-${preparedId}`);
if (prepVal === null || prepVal === "null") {
game.settings.set(CONFIG.l5r5e.systemName, `initiative-prepared-${preparedId}`, "actor");
}
});
// For some reasons, not always really ready, so wait a little
await new Promise((r) => setTimeout(r, 2000));