This commit is contained in:
Ukendio 2024-07-15 20:31:51 +02:00
parent 459e670ce9
commit 02548f2ac0

View file

@ -649,8 +649,8 @@ do
return nil
end
local records = archetype.records
local columns = archetype.records
local tr = archetype.records
local columns = archetype.columns
local row = record.row
local va = fetch(a, tr, columns, row)
@ -855,23 +855,17 @@ do
end
end
local cache
function world_query(world: World, ...: number): Query
-- breaking?
if (...) == nil then
error("Missing components")
end
indices = {}
compatibleArchetypes = {}
length = 0
components = { ... }
if cache then
compatibleArchetypes = cache
else
compatibleArchetypes = {}
local archetypes: { Archetype } = world.archetypes :: any
local firstArchetypeMap: ArchetypeMap
local componentIndex = world.componentIndex
@ -913,8 +907,6 @@ do
indices[length] = records
end
cache = compatibleArchetypes
end
lastArchetype = 1
archetype = compatibleArchetypes[lastArchetype]