mirror of
https://github.com/Ukendio/jecs.git
synced 2026-05-13 14:24:14 +00:00
change nth to use idr.records and pull out variables from iter
This commit is contained in:
parent
f79b894f86
commit
5a198495c8
1 changed files with 8 additions and 5 deletions
|
|
@ -3334,15 +3334,18 @@ local function world_new(DEBUG: boolean?)
|
|||
return NOOP :: () -> i53
|
||||
end
|
||||
|
||||
local idr_record = idr.records[archetype_id]
|
||||
local nth = 0
|
||||
local nth = idr.records[archetype_id]
|
||||
local end_count = nth + count
|
||||
|
||||
local entity_idx = world.entity_index
|
||||
local archetype_types = archetype.types
|
||||
|
||||
return function(): i53?
|
||||
if nth == count then
|
||||
if nth == end_count then
|
||||
return nil
|
||||
end
|
||||
local target = entity_index_get_alive(world.entity_index,
|
||||
ECS_PAIR_SECOND(archetype.types[nth + idr_record]))
|
||||
local target = entity_index_get_alive(entity_idx,
|
||||
ECS_PAIR_SECOND(archetype_types[nth]))
|
||||
nth += 1
|
||||
return target
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue