From 14a77c37b9945d78a7376e0db3acef191f075361 Mon Sep 17 00:00:00 2001 From: Erebus Date: Tue, 1 Dec 2020 06:43:25 +0100 Subject: [PATCH] Fixed migration --- module/helpers/migration-helper.js | 8 +++----- module/kh-main.js | 6 +++--- system.json | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/module/helpers/migration-helper.js b/module/helpers/migration-helper.js index e23a271..28ebcf7 100644 --- a/module/helpers/migration-helper.js +++ b/module/helpers/migration-helper.js @@ -8,11 +8,9 @@ export const migrateWorld = async function () { {permanent: true} ); - console.log(game.system.data.version) - + // Migrate to v0.0.3 from v0.0.2 and v0.0.1 game.items.forEach((item) => { - // Migrate to v0.1 from v0.0.1 and v0.0.1 - if (item.data.type === "spell") { + if(item.data.type === "spell") { item.update({"data.roll.label": "SPELL.ROLLTITLE"}); } }); @@ -20,4 +18,4 @@ export const migrateWorld = async function () { // Set the migration as complete game.settings.set("kopparhavet", "worldSchemaVersion", game.system.data.version); ui.notifications.info(`System Migration to version ${game.system.data.version} completed!`, { permanent: true }); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/module/kh-main.js b/module/kh-main.js index 44f33a1..9664591 100644 --- a/module/kh-main.js +++ b/module/kh-main.js @@ -21,7 +21,7 @@ Hooks.once("init", () => { scope: "world", config: true, default: 0, - type: Number, + type: String, }); game.settings.register("kopparhavet", "gameSystem", { name: "Game System", @@ -180,8 +180,8 @@ function registerHandlebarsHelpers() { function migrateWorld() { // Determine whether a system migration is required and feasible const currentVersion = game.settings.get("kopparhavet", "worldSchemaVersion"); - const NEEDS_MIGRATION_VERSION = 0.1; - const COMPATIBLE_MIGRATION_VERSION = 0; + const NEEDS_MIGRATION_VERSION = "0.0.3"; + const COMPATIBLE_MIGRATION_VERSION = '0' || isNaN('NaN'); let needMigration = currentVersion < NEEDS_MIGRATION_VERSION || currentVersion === null; // Perform the migration diff --git a/system.json b/system.json index 0047383..39f7639 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "kopparhavet", "title": "Kopparhavets Hjältar", "description": "The Molten Sea is a dangerous but exciting place, where pirates, sorcerers and secretive orders of knighthood struggle for power, wealth and ancient lore.", - "version": "0.1", + "version": "0.0.3", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.7", "templateVersion": 4,