Compare commits

..

No commits in common. "d99088ea1eadeccbd89058cc5934e2c7f4d76b7a" and "ebc39c8b28082f4290c6077d8475079bc8314582" have entirely different histories.

4 changed files with 11 additions and 30 deletions

View file

@ -714,12 +714,12 @@ local function id_record_ensure(world: World, id: Entity): ComponentRecord
if world_has_one_inline(world, relation, EcsExclusive) then
is_exclusive = true
end
end
else
local cleanup_policy = world_target(world, relation, EcsOnDelete, 0)
local cleanup_policy = world_target(world, relation, EcsOnDelete, 0)
if cleanup_policy == EcsDelete then
has_delete = true
if cleanup_policy == EcsDelete then
has_delete = true
end
end
local on_add, on_change, on_remove = world_get(world,
@ -2766,7 +2766,7 @@ local function world_new()
if idr then
local flags = idr.flags
if (bit32.btest(flags, ECS_ID_DELETE) == true) then
if bit32.btest(flags, ECS_ID_DELETE) then
for archetype_id in idr.records do
local idr_archetype = archetypes[archetype_id]
@ -2873,8 +2873,7 @@ local function world_new()
if idr_r then
local archetype_ids = idr_r.records
local flags = idr_r.flags
local has_delete_policy = bit32.btest(flags, ECS_ID_DELETE)
if has_delete_policy then
if bit32.btest(flags, ECS_ID_DELETE) then
for archetype_id in archetype_ids do
local idr_r_archetype = archetypes[archetype_id]
local entities = idr_r_archetype.entities
@ -3004,10 +3003,8 @@ local function world_new()
inner_world_set(world, EcsWildcard, EcsName, "jecs.Wildcard")
inner_world_set(world, EcsChildOf, EcsName, "jecs.ChildOf")
inner_world_set(world, EcsComponent, EcsName, "jecs.Component")
inner_world_set(world, EcsOnDelete, EcsName, "jecs.OnDelete")
inner_world_set(world, EcsOnDeleteTarget, EcsName, "jecs.OnDeleteTarget")
inner_world_set(world, EcsDelete, EcsName, "jecs.Delete")
inner_world_set(world, EcsRemove, EcsName, "jecs.Remove")
inner_world_set(world, EcsName, EcsName, "jecs.Name")
@ -3016,9 +3013,6 @@ local function world_new()
inner_world_add(world, EcsChildOf, ECS_PAIR(EcsOnDeleteTarget, EcsDelete))
inner_world_add(world, EcsChildOf, EcsExclusive)
inner_world_add(world, EcsOnDelete, EcsExclusive)
inner_world_add(world, EcsOnDeleteTarget, EcsExclusive)
for i = EcsRest + 1, ecs_max_tag_id do
entity_index_new_id(entity_index)
end

View file

@ -1,6 +1,6 @@
{
"name": "@rbxts/jecs",
"version": "0.9.0-rc.2",
"version": "0.9.0-rc.0",
"description": "Stupidly fast Entity Component System",
"main": "jecs.luau",
"repository": {

View file

@ -24,19 +24,6 @@ type Id<T=unknown> = jecs.Id<T>
local entity_visualiser = require("@tools/entity_visualiser")
local dwi = entity_visualiser.stringify
TEST("ardi", function()
local world = jecs.world()
local r = world:entity()
world:add(r, jecs.pair(jecs.OnDelete, jecs.Delete))
local e = world:entity()
local e1 = world:entity()
world:add(e, jecs.pair(r, e1))
world:delete(r)
CHECK(not world:contains(e))
end)
TEST("dai", function()
local world = jecs.world()
local C = world:component()
@ -634,9 +621,9 @@ TEST("world:delete()", function()
world:add(e1, ct)
world:add(e2, jecs.pair(ct, dummy))
-- world:delete(dummy)
world:delete(dummy)
-- CHECK(world:contains(e2))
CHECK(world:contains(e2))
world:delete(ct)

View file

@ -1,6 +1,6 @@
[package]
name = "ukendio/jecs"
version = "0.9.0-rc.2"
version = "0.9.0-rc.0"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"
license = "MIT"