mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 01:20:04 +00:00
Compare commits
1 commit
a38a0c33d7
...
6ba362c7a1
Author | SHA1 | Date | |
---|---|---|---|
|
6ba362c7a1 |
1 changed files with 3 additions and 7 deletions
10
jecs.luau
10
jecs.luau
|
@ -1562,21 +1562,17 @@ local function world_each(world: World, id): () -> ()
|
|||
return NOOP
|
||||
end
|
||||
|
||||
local entities = archetype.entities
|
||||
local row = #entities
|
||||
|
||||
local last = 0
|
||||
return function(): any
|
||||
local entity = entities[row]
|
||||
last += 1
|
||||
local entity = archetype.entities[last]
|
||||
while not entity do
|
||||
archetype_id = next(idr_cache, archetype_id)
|
||||
if not archetype_id then
|
||||
return
|
||||
end
|
||||
archetype = archetypes[archetype_id]
|
||||
entities = archetype.entities
|
||||
row = #entities
|
||||
end
|
||||
row -= 1
|
||||
return entity
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue