From 12287b12ef27a34e9a4516110f6c3951ced21e21 Mon Sep 17 00:00:00 2001 From: Shane <58125798+outofbearspace@users.noreply.github.com> Date: Tue, 30 Apr 2024 07:06:46 -0700 Subject: [PATCH] nil return for getSmallestMap() (#5) * nil return for getSmallestMap() * World type export --- lib/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/init.lua b/lib/init.lua index a3642de..26ac04b 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -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 -}) \ No newline at end of file +})