mirror of
				https://github.com/Ukendio/jecs.git
				synced 2025-11-04 02:49:18 +00:00 
			
		
		
		
	Use ecs_pair_first
This commit is contained in:
		
							parent
							
								
									eb315067f5
								
							
						
					
					
						commit
						bacda3c2e8
					
				
					 1 changed files with 6 additions and 3 deletions
				
			
		| 
						 | 
					@ -348,7 +348,7 @@ do
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	function world_get(world: World, entity: i53, a: i53, b: i53?, c: i53?, d: i53?, e: i53?): ...any
 | 
						function world_get(world: World, entity: i53, a: i53, b: i53?, c: i53?, d: i53?, e: i53?): ...any
 | 
				
			||||||
		local record = entity_index_try_get(world.entity_index, entity)
 | 
							local record = entity_index_try_get_fast(world.entity_index, entity)
 | 
				
			||||||
		if not record then
 | 
							if not record then
 | 
				
			||||||
			return nil
 | 
								return nil
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
| 
						 | 
					@ -379,7 +379,7 @@ do
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function world_get_one_inline(world: World, entity: i53, id: i53): any
 | 
					local function world_get_one_inline(world: World, entity: i53, id: i53): any
 | 
				
			||||||
	local record = entity_index_try_get(world.entity_index, entity)
 | 
						local record = entity_index_try_get_fast(world.entity_index, entity)
 | 
				
			||||||
	if not record then
 | 
						if not record then
 | 
				
			||||||
		return nil
 | 
							return nil
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
| 
						 | 
					@ -482,7 +482,10 @@ local function id_record_ensure(world: World, id: number): IdRecord
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if not idr then
 | 
						if not idr then
 | 
				
			||||||
		local flags = ECS_ID_MASK
 | 
							local flags = ECS_ID_MASK
 | 
				
			||||||
		local relation = ECS_ENTITY_T_HI(id)
 | 
							local relation = id
 | 
				
			||||||
 | 
							if ECS_IS_PAIR(id) then
 | 
				
			||||||
 | 
								relation = ecs_pair_first(world, id)
 | 
				
			||||||
 | 
							end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		local cleanup_policy = world_target(world, relation, EcsOnDelete, 0)
 | 
							local cleanup_policy = world_target(world, relation, EcsOnDelete, 0)
 | 
				
			||||||
		local cleanup_policy_target = world_target(world, relation, EcsOnDeleteTarget, 0)
 | 
							local cleanup_policy_target = world_target(world, relation, EcsOnDeleteTarget, 0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue