diff --git a/src/Export/Classes/GGPKData.lua b/src/Export/Classes/GGPKData.lua index 5454633361..c56c4c4c17 100644 --- a/src/Export/Classes/GGPKData.lua +++ b/src/Export/Classes/GGPKData.lua @@ -36,7 +36,7 @@ local GGPKClass = newClass("GGPKData", function(self, path, datPath, reExport) self.oozPath = datPath:match("\\$") and datPath or (datPath .. "\\") else self.path = path - self.oozPath = io.popen("cd"):read('*l'):gsub('\r?', '') .. "\\ggpk\\" + self.oozPath = GetWorkDir() .. "\\ggpk\\" self:CleanDir(reExport) self:ExtractFiles(reExport) end @@ -125,14 +125,13 @@ function GGPKClass:ExtractList(listToExtract, cache, useRegex) end function GGPKClass:AddDat64Files() - local datFiles = scanDir(self.oozPath .. "Data\\", '%w+%.datc64$') - for _, f in ipairs(datFiles) do + local datFiles = self:GetNeededFiles() + for _, fname in ipairs(datFiles) do local record = { } - record.name = f - local rawFile = io.open(self.oozPath .. "Data\\" .. f, 'rb') + record.name = fname:match("([^/\\]+)$") .. "c64" + local rawFile = io.open(self.oozPath .. fname:gsub("/", "\\") .. "c64", 'rb') record.data = rawFile:read("*all") rawFile:close() - --ConPrintf("FILENAME: %s", fname) t_insert(self.dat, record) end end