mirror of
https://github.com/Ukendio/jecs.git
synced 2026-05-13 14:24:14 +00:00
local NOOP fn
This commit is contained in:
parent
5a198495c8
commit
b954588b0e
1 changed files with 6 additions and 4 deletions
|
|
@ -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]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue