nil return for getSmallestMap() (#5)

* nil return for getSmallestMap()

* World type export
This commit is contained in:
Shane 2024-04-30 07:06:46 -07:00 committed by GitHub
parent dc73c03d74
commit 12287b12ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -194,7 +194,7 @@ local function onNotifyAdd(world, archetype, otherArchetype, row: number, added:
end
type World = typeof(World.new())
export type World = typeof(World.new())
local function ensureArchetype(world: World, types, prev)
if #types < 1 then
@ -360,7 +360,7 @@ local function getSmallestMap(componentIndex, components)
end
end
return s.sparse
return s and s.sparse or nil
end
function World.query(world: World, ...: i53): any
@ -581,4 +581,4 @@ return table.freeze({
ON_ADD = ON_ADD,
ON_REMOVE = ON_REMOVE,
ON_SET = ON_SET
})
})