Compare commits

..

3 commits

Author SHA1 Message Date
Denizhan Dakılır
1bc49df750
Merge 7b870e8f3c into 62af051e7a 2025-03-01 22:46:08 +01:00
Ukendio
62af051e7a Bump 2025-03-01 20:16:26 +01:00
Ukendio
a5dad9aa4d Fix entity deletion swap logic 2025-03-01 20:15:52 +01:00
3 changed files with 18 additions and 1 deletions

View file

@ -950,6 +950,7 @@ local function archetype_delete(world: World, archetype: Archetype, row: number,
record_to_move.row = row
end
delete = entities[row]
entities[row] = move
end

View file

@ -1045,6 +1045,22 @@ TEST("world:component()", function()
end)
TEST("world:delete", function()
do CASE "invoke OnRemove hooks"
local world = world_new()
local e1 = world:entity()
local e2 = world:entity()
local Stable = world:component()
world:set(Stable, jecs.OnRemove, function(e)
CHECK(e == e1)
end)
world:set(e1, Stable, true)
world:set(e2, Stable, true)
world:delete(e1)
end
do CASE "delete recycled entity id used as component"
local world = world_new()
local id = world:entity()

View file

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