Compare commits

..

3 commits

Author SHA1 Message Date
PepeElToro41
6a52ad6cec
Merge f912866fcb into 0b6bfea5c8 2025-08-02 16:10:49 -07:00
Ukendio
0b6bfea5c8 Return nil if nth is over count
Some checks failed
analysis / Run Luau Analyze (push) Has been cancelled
deploy-docs / build (push) Has been cancelled
publish-npm / publish (push) Has been cancelled
unit-testing / Run Luau Tests (push) Has been cancelled
deploy-docs / Deploy (push) Has been cancelled
2025-08-02 23:57:50 +02:00
Ukendio
3cfce10a4a Increment component records after registering
Some checks are pending
analysis / Run Luau Analyze (push) Waiting to run
deploy-docs / build (push) Waiting to run
deploy-docs / Deploy (push) Blocked by required conditions
publish-npm / publish (push) Waiting to run
unit-testing / Run Luau Tests (push) Waiting to run
2025-08-02 18:58:19 +02:00

View file

@ -737,7 +737,7 @@ local function world_target(world: world, entity: i53, relation: i53, index: num
local nth = index or 0
if nth >= count then
nth = nth + count + 1
return nil
end
nth = archetype.types[nth + idr.records[archetype_id]]
@ -889,6 +889,7 @@ local function archetype_create(world: world, id_types: { i53 }, ty, prev: i53?)
for i, component_id in archetype.types do
local idr = id_record_ensure(world, component_id)
idr.size += 1
local is_tag = bit32.btest(idr.flags, ECS_ID_IS_TAG)
local column = if is_tag then NULL_ARRAY else {}
columns[i] = column
@ -900,11 +901,13 @@ local function archetype_create(world: world, id_types: { i53 }, ty, prev: i53?)
local object = ECS_PAIR_SECOND(component_id)
local r = ECS_PAIR(relation, EcsWildcard)
local idr_r = id_record_ensure(world, r)
idr_r.size += 1
archetype_append_to_records(idr_r, archetype_id, columns_map, r, i, column)
local t = ECS_PAIR(EcsWildcard, object)
local idr_t = id_record_ensure(world, t)
idr_t.size += 1
archetype_append_to_records(idr_t, archetype_id, columns_map, t, i, column)
end
@ -2769,7 +2772,7 @@ local function world_new()
local nth = index or 0
if nth >= count then
nth = nth + count + 1
return nil
end
nth = archetype.types[nth + idr.records[archetype_id]]