Skip to content

Commit 6ba9ed6

Browse files
committed
Restore ability to save any previously loaded specs before switching
1 parent c86bb98 commit 6ba9ed6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Export/Main.lua

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,13 @@ function main:LoadDatSource(value)
336336
self.leagueLabel = nil
337337
local reExportState = self.reExportGGPKData
338338
self.reExportGGPKData = true
339+
if self.datSource then
340+
local out = io.open(self.datSource.spec..(self.datSource.spec:match("%.lua$") and "" or ".lua"), "w")
341+
out:write('return ')
342+
writeLuaTable(out, self.datSpecs, 1)
343+
out:close()
344+
end
339345
self.datSource = value
340-
local out = io.open(self.datSource.spec..(self.datSource.spec:match("%.lua$") and "" or ".lua"), "w")
341-
out:write('return ')
342-
writeLuaTable(out, self.datSpecs, 1)
343-
out:close()
344346
self.datSpecs = LoadModule(self.datSource.spec)
345347
self:InitGGPK()
346348
if USE_DAT64 then

0 commit comments

Comments
 (0)