Ensure that world:exists uses the safe try_get_any

This commit is contained in:
Ukendio 2026-02-20 04:41:57 +01:00
parent 4b10b622bf
commit f9764634e6

View file

@ -3718,7 +3718,11 @@ local function world_new(DEBUG: boolean?)
end end
local function world_exists(world: world, entity: i53): boolean local function world_exists(world: world, entity: i53): boolean
return entity_index_try_get_any(entity) ~= nil local r = entity_index_try_get_any(entity)
if not r or r.dense == 0 then
return false
end
return true
end end
local function world_contains(world: world, entity: i53): boolean local function world_contains(world: world, entity: i53): boolean