Ukendio / jecs

A fast, portable Entity Component System for Luau
https://ukendio.github.io/jecs/
MIT License
121 stars 20 forks source link

[v0.1.0] Iterating `world` after calling `world:delete(entityId)` throws an error #47

Closed knnyism closed 1 month ago

knnyism commented 3 months ago

When an entity is deleted, World.__iter tries getting the archetype of a non-existent sparse array record.

local world = jecs.World.new()

local entity = world:entity()

world:delete(entity)

for e in world do -- jecs:839: attempt to index nil with 'archetype' 

end
Ukendio commented 3 months ago

I have a fix for this. It will be fixed alongside the linked-records-traversal PR

Ukendio commented 1 month ago

This has been fixed in commit https://github.com/Ukendio/jecs/commit/735eb0152664f550be613f8299b1bc5ca1252e76