diff --git a/system/scripts/hooks.js b/system/scripts/hooks.js index 00464b8..ea20c7e 100644 --- a/system/scripts/hooks.js +++ b/system/scripts/hooks.js @@ -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));