From 3b6abeb20641b8e9a7b7aed13d992c9d98860b85 Mon Sep 17 00:00:00 2001 From: ppoelzl <33464174+ppoelzl@users.noreply.github.com> Date: Sun, 23 Feb 2020 03:18:38 +0100 Subject: [PATCH 1/2] Disable rebuilding the legacy (2.6) mod cache --- Modules/Main.lua | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/Modules/Main.lua b/Modules/Main.lua index 024d35fa..ec0ce1a3 100644 --- a/Modules/Main.lua +++ b/Modules/Main.lua @@ -109,27 +109,25 @@ function main:Init() end if self.rebuildModCache then - -- Update mod caches - for _, targetVersion in ipairs(targetVersionList) do - local out = io.open("Data/"..targetVersion.."/ModCache.lua", "w") - out:write('local c=...') - for line, dat in pairs(modLib.parseModCache[targetVersion]) do - if not dat[1] or not dat[1][1] or dat[1][1].name ~= "JewelFunc" then - out:write('c["', line:gsub("\n","\\n"), '"]={') - if dat[1] then - writeLuaTable(out, dat[1]) - else - out:write('nil') - end - if dat[2] then - out:write(',"', dat[2]:gsub("\n","\\n"), '"}') - else - out:write(',nil}') - end + -- Update mod cache + local out = io.open("Data/"..liveTargetVersion.."/ModCache.lua", "w") + out:write('local c=...') + for line, dat in pairs(modLib.parseModCache[liveTargetVersion]) do + if not dat[1] or not dat[1][1] or dat[1][1].name ~= "JewelFunc" then + out:write('c["', line:gsub("\n","\\n"), '"]={') + if dat[1] then + writeLuaTable(out, dat[1]) + else + out:write('nil') + end + if dat[2] then + out:write(',"', dat[2]:gsub("\n","\\n"), '"}') + else + out:write(',nil}') end end - out:close() end + out:close() end self.sharedItemList = { } From 7da894513026e790bea3c6c5d2c2940afa1e1d87 Mon Sep 17 00:00:00 2001 From: ppoelzl <33464174+ppoelzl@users.noreply.github.com> Date: Sun, 23 Feb 2020 03:29:09 +0100 Subject: [PATCH 2/2] Put mods in mod cache on separate lines --- Modules/Main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Main.lua b/Modules/Main.lua index ec0ce1a3..382ade18 100644 --- a/Modules/Main.lua +++ b/Modules/Main.lua @@ -121,9 +121,9 @@ function main:Init() out:write('nil') end if dat[2] then - out:write(',"', dat[2]:gsub("\n","\\n"), '"}') + out:write(',"', dat[2]:gsub("\n","\\n"), '"}\n') else - out:write(',nil}') + out:write(',nil}\n') end end end