Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions rokit.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tools]
wally = "upliftgames/[email protected]"
rojo = "rojo-rbx/[email protected]"
luau = "luau-lang/[email protected]"
[tools]
wally = "upliftgames/[email protected]"
rojo = "rojo-rbx/[email protected]"
luau = "luau-lang/[email protected]"
zune = "scythe-technology/[email protected]"
18 changes: 15 additions & 3 deletions src/jecs.luau
Original file line number Diff line number Diff line change
Expand Up @@ -3864,12 +3864,24 @@ local function world_new(DEBUG: boolean?)
return world
end

local function ecs_is_tag(world: world, entity: i53): boolean
local idr = world.component_index[entity]
local function ecs_is_tag(world: world, id: i53): boolean
local idr = world.component_index[id]
if idr then
return bit32.btest(idr.flags, ECS_ID_IS_TAG)
end
return not WORLD_HAS(world, entity, EcsComponent)
if ECS_IS_PAIR(id) then
local relation = entity_index_get_alive(entity_index, ECS_PAIR_FIRST(id)) :: i53
if not relation then
return false
end
if WORLD_HAS(world, relation, EcsComponent) then
return false
end
local target = entity_index_get_alive(entity_index, ECS_PAIR_SECOND(id)) :: i53
if not target then return false end
return not WORLD_HAS(world, target, EcsComponent)
end
return not WORLD_HAS(world, id, EcsComponent)
end

local function ecs_entity_record(world: world, entity: i53)
Expand Down