This commit is contained in:
kalrnlo 2024-06-23 20:45:15 -04:00
parent bd6eab315f
commit faf9b365cf

View file

@ -114,9 +114,8 @@ local function ECS_GENERATION_INC(e: i53)
local generation = flags % ECS_GENERATION_MASK
return ECS_COMBINE(id, generation + 1) + flags
else
return ECS_COMBINE(e, 1)
end
return ECS_COMBINE(e, 1)
end
-- FIRST gets the high ID
@ -834,8 +833,7 @@ function World.__iter(world: World): WorldIterator
-- new solver doesnt like the world iterator type even tho its correct
-- so any cast here i come
local iterator: WorldIterator = (
function()
local function iterator()
local lastEntity: number?, entityId: number = next(dense, last)
if not lastEntity then
-- ignore type error
@ -863,12 +861,11 @@ function World.__iter(world: World): WorldIterator
return entityId, entityData
end
) :: any
return iterator
return iterator :: any
end
-- freezing it incase somebody trys doing something stupid and modifying it
-- freezing it incase somebody tries doing something stupid and modifying it
-- (unlikely but its easy to add extra safety so)
table.freeze(World)