Fix typings

This commit is contained in:
Ukendio 2024-04-24 20:00:33 +02:00
parent 970091f9a9
commit fb47f87bd4
2 changed files with 4 additions and 5 deletions

View file

@ -48,4 +48,3 @@ assert(world:get(opponentId, Health) == 92)
```
![Comparison](image.png)
s

View file

@ -326,7 +326,7 @@ local function noop(): any
end
end
function World.query(world: World, ...: i53): () -> (number, ...any)
function World.query(world: World, ...: i53): (() -> (number, ...any)) | () -> ()
local compatibleArchetypes = {}
local components = { ... }
local archetypes = world.archetypes
@ -368,11 +368,11 @@ function World.query(world: World, ...: i53): () -> (number, ...any)
end
end
local function double(): any
local function double()
local lastArchetype, archetype = next(compatibleArchetypes)
local lastRow
return function(): any
return function()
local row = next(archetype.entities, lastRow)
while row == nil do
lastArchetype, archetype = next(compatibleArchetypes, lastArchetype)
@ -411,7 +411,7 @@ function World.query(world: World, ...: i53): () -> (number, ...any)
local lastRow
local function queryNext(): (...any)
local function queryNext()
local row = next(archetype.entities, lastRow)
while row == nil do
lastArchetype, archetype = next(compatibleArchetypes, lastArchetype)