Index: binaries/data/mods/mod/gui/common/mod.js =================================================================== --- /dev/null +++ binaries/data/mods/mod/gui/common/mod.js @@ -0,0 +1,22 @@ +/** + * Check the mod compatibility between the saved game to be loaded and the engine + * + * @param metadata {string[]} + * @param engineInfo {string[]} + * @returns {boolean} + */ +function hasSameMods(metadata, engineInfo) +{ + if (!metadata.mods || !engineInfo.mods) + return false; + + // Ignore the "user" mod which is loaded for releases but not working-copies + let modsA = metadata.mods.filter(mod => mod != "user"); + let modsB = engineInfo.mods.filter(mod => mod != "user"); + + if (modsA.length != modsB.length) + return false; + + // Mods must be loaded in the same order + return modsA.every((mod, index) => mod == modsB[index]); +} Index: binaries/data/mods/public/gui/common/functions_utility_loadsave.js =================================================================== --- binaries/data/mods/public/gui/common/functions_utility_loadsave.js +++ binaries/data/mods/public/gui/common/functions_utility_loadsave.js @@ -46,29 +46,6 @@ return metadata.engine_version && metadata.engine_version == engineInfo.engine_version; } -/** - * Check the mod compatibility between the saved game to be loaded and the engine - * - * @param metadata {string[]} - * @param engineInfo {string[]} - * @returns {boolean} - */ -function hasSameMods(metadata, engineInfo) -{ - if (!metadata.mods || !engineInfo.mods) - return false; - - // Ignore the "user" mod which is loaded for releases but not working-copies - let modsA = metadata.mods.filter(mod => mod != "user"); - let modsB = engineInfo.mods.filter(mod => mod != "user"); - - if (modsA.length != modsB.length) - return false; - - // Mods must be loaded in the same order - return modsA.every((mod, index) => mod == modsB[index]); -} - function deleteGame() { let gameSelection = Engine.GetGUIObjectByName("gameSelection");