mirror of
				https://github.com/Ukendio/jecs.git
				synced 2025-11-04 10:59:18 +00:00 
			
		
		
		
	Correct indentation on numbers
This commit is contained in:
		
							parent
							
								
									bab4065a1e
								
							
						
					
					
						commit
						0ab66f416d
					
				
					 1 changed files with 6 additions and 7 deletions
				
			
		| 
						 | 
					@ -91,8 +91,8 @@ local EcsRemove =         HI_COMPONENT_ID + 10
 | 
				
			||||||
local EcsName =           HI_COMPONENT_ID + 11
 | 
					local EcsName =           HI_COMPONENT_ID + 11
 | 
				
			||||||
local EcsRest =           HI_COMPONENT_ID + 12
 | 
					local EcsRest =           HI_COMPONENT_ID + 12
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local ECS_PAIR_FLAG =                      0x8
 | 
					local ECS_PAIR_FLAG =                       0x8
 | 
				
			||||||
local ECS_ID_FLAGS_MASK =                 0x10
 | 
					local ECS_ID_FLAGS_MASK =                  0x10
 | 
				
			||||||
local ECS_ENTITY_MASK =     bit32.lshift(1, 24)
 | 
					local ECS_ENTITY_MASK =     bit32.lshift(1, 24)
 | 
				
			||||||
local ECS_GENERATION_MASK = bit32.lshift(1, 16)
 | 
					local ECS_GENERATION_MASK = bit32.lshift(1, 16)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -173,6 +173,9 @@ end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function entity_index_try_get_any(entity_index: EntityIndex, entity: number): Record?
 | 
					local function entity_index_try_get_any(entity_index: EntityIndex, entity: number): Record?
 | 
				
			||||||
	local r = entity_index.sparse_array[ECS_ENTITY_T_LO(entity)]
 | 
						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
 | 
						if not r or r.dense == 0 then
 | 
				
			||||||
		return nil
 | 
							return nil
 | 
				
			||||||
| 
						 | 
					@ -1610,14 +1613,12 @@ if _G.__JECS_DEBUG then
 | 
				
			||||||
	World.set = function(world: World, entity: i53, id: i53, value: any): ()
 | 
						World.set = function(world: World, entity: i53, id: i53, value: any): ()
 | 
				
			||||||
		local is_tag = ID_IS_TAG(world, id)
 | 
							local is_tag = ID_IS_TAG(world, id)
 | 
				
			||||||
		if is_tag and value == nil then
 | 
							if is_tag and value == nil then
 | 
				
			||||||
			world_add(world, entity, id)
 | 
					 | 
				
			||||||
			local _1 = get_name(world, entity)
 | 
								local _1 = get_name(world, entity)
 | 
				
			||||||
			local _2 = get_name(world, id)
 | 
								local _2 = get_name(world, id)
 | 
				
			||||||
			local why = "cannot set component value to nil"
 | 
								local why = "cannot set component value to nil"
 | 
				
			||||||
			throw(why)
 | 
								throw(why)
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		elseif value ~= nil and is_tag then
 | 
							elseif value ~= nil and is_tag then
 | 
				
			||||||
			world_add(world, entity, id)
 | 
					 | 
				
			||||||
			local _1 = get_name(world, entity)
 | 
								local _1 = get_name(world, entity)
 | 
				
			||||||
			local _2 = get_name(world, id)
 | 
								local _2 = get_name(world, id)
 | 
				
			||||||
			local why = `cannot set a component value because {_2} is a tag`
 | 
								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)
 | 
						World.add = function(world: World, entity: i53, id: i53, value: nil)
 | 
				
			||||||
		if value ~= nil then
 | 
							if value ~= nil then
 | 
				
			||||||
			local _1 = get_name(world, entity)
 | 
								local _1 = get_name(world, entity) 			local _2 = get_name(world, id)
 | 
				
			||||||
			local _2 = get_name(world, id)
 | 
					 | 
				
			||||||
			throw("You provided a value when none was expected. " .. `Did you mean to use "world:add({_1}, {_2})"`)
 | 
								throw("You provided a value when none was expected. " .. `Did you mean to use "world:add({_1}, {_2})"`)
 | 
				
			||||||
			return
 | 
					 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		world_add(world, entity, id)
 | 
							world_add(world, entity, id)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue