Skip to content

Commit 3341a73

Browse files
committed
Tools: Fix an oversight in the water types analysis script
The file list should contain both RSW and GND maps, but unpacking files with duplicate indices doesn't work the same way in Lua as it does in JavaScript. The end result is that only the GND maps are collected as the previously unpacked keys are overwritten.
1 parent 187f8a4 commit 3341a73

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Tools/analyze-water-types.lua

+11-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,23 @@ local FileAnalyzer = require("Tools.FileAnalyzer")
77
local console = require("console")
88
local json = require("json")
99

10+
local table_insert = table.insert
11+
1012
local grfPath = "data.grf"
1113
local grf = RagnarokGRF()
1214
grf:Open(grfPath)
1315

1416
local rswFileList = grf:FindFilesByType("rsw")
1517
local gndFileList = grf:FindFilesByType("gnd")
16-
local fileList = { unpack(rswFileList), unpack(gndFileList) }
18+
local fileList = {}
19+
20+
for index, grfEntry in ipairs(rswFileList) do
21+
table_insert(fileList, grfEntry)
22+
end
23+
24+
for index, grfEntry in ipairs(gndFileList) do
25+
table_insert(fileList, grfEntry)
26+
end
1727

1828
AnimatedWaterPlane.PREALLOCATE_GEOMETRY_BUFFERS = false -- Will run OOM here if preallocating all these buffers
1929

0 commit comments

Comments
 (0)