Return nil if nth is over count
Some checks failed
analysis / Run Luau Analyze (push) Has been cancelled
deploy-docs / build (push) Has been cancelled
publish-npm / publish (push) Has been cancelled
unit-testing / Run Luau Tests (push) Has been cancelled
deploy-docs / Deploy (push) Has been cancelled

This commit is contained in:
Ukendio 2025-08-02 23:57:50 +02:00
parent 3cfce10a4a
commit 0b6bfea5c8

View file

@ -733,7 +733,7 @@ local function world_target(world: world, entity: i53, relation: i53, index: num
local nth = index or 0 local nth = index or 0
if nth >= count then if nth >= count then
nth = nth + count + 1 return nil
end end
nth = archetype.types[nth + idr.records[archetype_id]] nth = archetype.types[nth + idr.records[archetype_id]]
@ -2759,7 +2759,7 @@ local function world_new()
local nth = index or 0 local nth = index or 0
if nth >= count then if nth >= count then
nth = nth + count + 1 return nil
end end
nth = archetype.types[nth + idr.records[archetype_id]] nth = archetype.types[nth + idr.records[archetype_id]]