local NOOP fn

This commit is contained in:
kurokuukyo 2026-04-20 20:11:08 -04:00
parent 5a198495c8
commit b954588b0e

View file

@ -3311,27 +3311,29 @@ local function world_new(DEBUG: boolean?)
end end
local function world_targets(world: world, entity: i53, relation: i53): () -> i53? local function world_targets(world: world, entity: i53, relation: i53): () -> i53?
local NOOP = NOOP :: () -> i53
local record = entity_index_try_get_unsafe(entity) local record = entity_index_try_get_unsafe(entity)
if not record then if not record then
return NOOP :: () -> i53 return NOOP
end end
local archetype = record.archetype local archetype = record.archetype
if not archetype then if not archetype then
return NOOP :: () -> i53 return NOOP
end end
local r = ECS_PAIR(relation, EcsWildcard) local r = ECS_PAIR(relation, EcsWildcard)
local idr = world.component_index[r] local idr = world.component_index[r]
if not idr then if not idr then
return NOOP :: () -> i53 return NOOP
end end
local archetype_id = archetype.id local archetype_id = archetype.id
local count = idr.counts[archetype_id] local count = idr.counts[archetype_id]
if not count then if not count then
return NOOP :: () -> i53 return NOOP
end end
local nth = idr.records[archetype_id] local nth = idr.records[archetype_id]