Correct indentation on numbers

This commit is contained in:
Ukendio 2024-11-16 17:12:12 +01:00
parent bab4065a1e
commit 0ab66f416d

View file

@ -173,6 +173,9 @@ end
local function entity_index_try_get_any(entity_index: EntityIndex, entity: number): Record?
local r = entity_index.sparse_array[ECS_ENTITY_T_LO(entity)]
if not r then
return nil
end
if not r or r.dense == 0 then
return nil
@ -1610,14 +1613,12 @@ if _G.__JECS_DEBUG then
World.set = function(world: World, entity: i53, id: i53, value: any): ()
local is_tag = ID_IS_TAG(world, id)
if is_tag and value == nil then
world_add(world, entity, id)
local _1 = get_name(world, entity)
local _2 = get_name(world, id)
local why = "cannot set component value to nil"
throw(why)
return
elseif value ~= nil and is_tag then
world_add(world, entity, id)
local _1 = get_name(world, entity)
local _2 = get_name(world, id)
local why = `cannot set a component value because {_2} is a tag`
@ -1631,10 +1632,8 @@ if _G.__JECS_DEBUG then
World.add = function(world: World, entity: i53, id: i53, value: nil)
if value ~= nil then
local _1 = get_name(world, entity)
local _2 = get_name(world, id)
local _1 = get_name(world, entity) local _2 = get_name(world, id)
throw("You provided a value when none was expected. " .. `Did you mean to use "world:add({_1}, {_2})"`)
return
end
world_add(world, entity, id)