Compare commits

...

3 commits

Author SHA1 Message Date
Clown
0f08d3c254
Merge 96bed9bd7e into 69911093a3 2025-07-23 23:54:16 +07:00
Ukendio
69911093a3 No need to check for 0 anymore
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-07-23 00:38:16 +02:00
YetAnotherClown
96bed9bd7e Empty Commit 2025-02-25 11:28:04 -05:00
2 changed files with 16 additions and 19 deletions

View file

@ -2191,11 +2191,6 @@ local function world_new()
local function inner_entity_index_try_get_any(entity: number): Record?
local r = eindex_sparse_array[ECS_ENTITY_T_LO(entity)]
if not r or r.dense == 0 then
return nil
end
return r
end
@ -2284,7 +2279,7 @@ local function world_new()
-- end
local function inner_entity_index_try_get_unsafe(entity: number): Record?
local r = inner_entity_index_try_get_any(entity)
local r = eindex_sparse_array[ECS_ENTITY_T_LO(entity)]
if r then
local r_dense = r.dense
-- if r_dense > entity_index.alive_count then
@ -3146,17 +3141,6 @@ return {
pair_second = (ecs_pair_second :: any) :: <P, O>(world: World, pair: Pair<P, O>) -> Id<O>,
entity_index_get_alive = entity_index_get_alive,
-- Inwards facing API for testing
ECS_ID = ECS_ENTITY_T_LO,
ECS_GENERATION_INC = ECS_GENERATION_INC,
ECS_GENERATION = ECS_GENERATION,
ECS_ID_IS_WILDCARD = ECS_ID_IS_WILDCARD,
ECS_ID_IS_EXCLUSIVE = ECS_ID_IS_EXCLUSIVE,
ECS_ID_DELETE = ECS_ID_DELETE,
ECS_META_RESET = ECS_META_RESET,
ECS_COMBINE = ECS_COMBINE,
ECS_ENTITY_MASK = ECS_ENTITY_MASK,
archetype_append_to_records = archetype_append_to_records,
id_record_ensure = id_record_ensure,
component_record = id_record_get,
@ -3181,6 +3165,8 @@ return {
entity_index_is_alive = entity_index_is_alive,
entity_index_new_id = entity_index_new_id,
Query = Query,
query_iter = query_iter,
query_iter_init = query_iter_init,
query_with = query_with,
@ -3189,4 +3175,15 @@ return {
query_match = query_match,
find_observers = find_observers,
-- Inwards facing API for testing
ECS_ID = ECS_ENTITY_T_LO,
ECS_GENERATION_INC = ECS_GENERATION_INC,
ECS_GENERATION = ECS_GENERATION,
ECS_ID_IS_WILDCARD = ECS_ID_IS_WILDCARD,
ECS_ID_IS_EXCLUSIVE = ECS_ID_IS_EXCLUSIVE,
ECS_ID_DELETE = ECS_ID_DELETE,
ECS_META_RESET = ECS_META_RESET,
ECS_COMBINE = ECS_COMBINE,
ECS_ENTITY_MASK = ECS_ENTITY_MASK,
}

View file

@ -2220,14 +2220,14 @@ TEST("change tracking", function()
world:set(e2, Foo, 2)
local i = 0
for e, new in q1 :: any do
for e, new in q1 do
i += 1
world:set(e, pair(Previous, Foo), new)
end
CHECK(i == 2)
local j = 0
for e, new in q1 :: any do
for e, new in q1 do
j += 1
world:set(e, pair(Previous, Foo), new)
end