Fix iterator not returning correct column for 8+ overloads

This commit is contained in:
Ukendio 2025-07-19 14:29:14 +02:00
parent 78fe5338cf
commit 3e995c9d7d
2 changed files with 3 additions and 2 deletions

View file

@ -1428,7 +1428,7 @@ local function query_iter_init(query: QueryInner): () -> (number, ...any)
i -= 1
for i = 9, ids_len do
output[i - 8] = columns_map[i][row]
output[i - 8] = columns_map[ids[i]][row]
end
return entity, a[row], b[row], c[row], d[row], e[row], f[row], g[row], h[row], unpack(output)
@ -1903,7 +1903,7 @@ local function query_cached(query: QueryInner)
i -= 1
for i = 9, ids_len do
output[i - 8] = columns_map[i][row]
output[i - 8] = columns_map[ids[i]][row]
end
return entity, a[row], b[row], c[row], d[row], e[row], f[row], g[row], unpack(output)

View file

@ -1536,6 +1536,7 @@ TEST("world:query()", function()
for i = 1, 9 do
local id = world:component()
world:component() -- make the components sparsely interleaved
components[i] = id
end
local e1 = world:entity()