Skip to content

Commit 78185fc

Browse files
github-actions[bot]LocalIdentityLocalIdentity
authored
[pob2-port] Speed up load times of exporter (#9404)
* Apply changes from PathOfBuildingCommunity/PathOfBuilding-PoE2#1638 * Fix merge conflict --------- Co-authored-by: LocalIdentity <[email protected]> Co-authored-by: LocalIdentity <[email protected]>
1 parent 59643b0 commit 78185fc

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Export/Classes/GGPKData.lua

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ local GGPKClass = newClass("GGPKData", function(self, path, datPath, reExport)
3636
self.oozPath = datPath:match("\\$") and datPath or (datPath .. "\\")
3737
else
3838
self.path = path
39-
self.oozPath = io.popen("cd"):read('*l'):gsub('\r?', '') .. "\\ggpk\\"
39+
self.oozPath = GetWorkDir() .. "\\ggpk\\"
4040
self:CleanDir(reExport)
4141
self:ExtractFiles(reExport)
4242
end
@@ -125,14 +125,13 @@ function GGPKClass:ExtractList(listToExtract, cache, useRegex)
125125
end
126126

127127
function GGPKClass:AddDat64Files()
128-
local datFiles = scanDir(self.oozPath .. "Data\\", '%w+%.datc64$')
129-
for _, f in ipairs(datFiles) do
128+
local datFiles = self:GetNeededFiles()
129+
for _, fname in ipairs(datFiles) do
130130
local record = { }
131-
record.name = f
132-
local rawFile = io.open(self.oozPath .. "Data\\" .. f, 'rb')
131+
record.name = fname:match("([^/\\]+)$") .. "c64"
132+
local rawFile = io.open(self.oozPath .. fname:gsub("/", "\\") .. "c64", 'rb')
133133
record.data = rawFile:read("*all")
134134
rawFile:close()
135-
--ConPrintf("FILENAME: %s", fname)
136135
t_insert(self.dat, record)
137136
end
138137
end

0 commit comments

Comments
 (0)