diff --git a/support_files/loca_convert.js b/support_files/loca_convert.js index e126ccb4..396b008b 100644 --- a/support_files/loca_convert.js +++ b/support_files/loca_convert.js @@ -10,7 +10,13 @@ var to_loca; var LSLIB; async function lslib_load() { - LSLIB = await LOAD_LSLIB(); + if (LSLIB === undefined) { + raiseInfo("lslib not found. loading...", false); + LSLIB = await LOAD_LSLIB(); + // console.log(typeof(LSLIB)) + } else { + raiseInfo("lslib is already loaded!", false); + } } diff --git a/support_files/lsf_convert.js b/support_files/lsf_convert.js index 4a3b22ba..716e5474 100644 --- a/support_files/lsf_convert.js +++ b/support_files/lsf_convert.js @@ -14,7 +14,13 @@ var to_lsf; var LSLIB; async function lslib_load() { - LSLIB = await LOAD_LSLIB(); + if (LSLIB === undefined) { + console.log("lslib not found. loading..."); + LSLIB = await LOAD_LSLIB(); + // console.log(typeof(LSLIB)) + } else { + console.log("lslib is already loaded!"); + } } diff --git a/support_files/process_pak.js b/support_files/process_pak.js index 156c87e9..6af8035c 100644 --- a/support_files/process_pak.js +++ b/support_files/process_pak.js @@ -36,7 +36,7 @@ if (isMainThread) { function prepareTempDir(movedPak = false) { let rootModPath; if (isMainThread) { - rootModPath = getConfig().rootModPath; + rootModPath = getConfig.rootModPath; } else { rootModPath = getConfig.rootModPath; } @@ -45,8 +45,6 @@ function prepareTempDir(movedPak = false) { const temp_path = path.join(rootParentPath, temp_folder); // console.log('test11') - console.log(rootParentPath) - console.log(rootModPath) if (!(fs.existsSync(temp_path))) { console.log("making temp_path"); fs.mkdirSync(temp_path, { recursive: true}); @@ -75,8 +73,8 @@ async function processPak(modPath, modName, unpackLocation = path.join(path.dirn let rootModPath, modDestPath; if (isMainThread) { - rootModPath = getConfig().rootModPath; - modDestPath = getConfig().modDestPath; + rootModPath = getConfig.rootModPath; + modDestPath = getConfig.modDestPath; } else { rootModPath = getConfig.rootModPath; @@ -130,4 +128,5 @@ async function processPak(modPath, modName, unpackLocation = path.join(path.dirn } } +lslib_load(); module.exports = { processPak, prepareTempDir }; \ No newline at end of file