mirror of
				https://github.com/Ukendio/jecs.git
				synced 2025-11-03 18:39:19 +00:00 
			
		
		
		
	Increment component records after registering
	
		
			
	
		
	
	
		
	
		
			Some checks are pending
		
		
	
	
	
				
					
				
			
		
			Some checks are pending
		
		
	
	
This commit is contained in:
		
							parent
							
								
									add9ad3939
								
							
						
					
					
						commit
						3cfce10a4a
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
					@ -879,6 +879,7 @@ local function archetype_create(world: world, id_types: { i53 }, ty, prev: i53?)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for i, component_id in archetype.types do
 | 
						for i, component_id in archetype.types do
 | 
				
			||||||
		local idr = id_record_ensure(world, component_id)
 | 
							local idr = id_record_ensure(world, component_id)
 | 
				
			||||||
 | 
							idr.size += 1
 | 
				
			||||||
		local is_tag = bit32.btest(idr.flags, ECS_ID_IS_TAG)
 | 
							local is_tag = bit32.btest(idr.flags, ECS_ID_IS_TAG)
 | 
				
			||||||
		local column = if is_tag then NULL_ARRAY else {}
 | 
							local column = if is_tag then NULL_ARRAY else {}
 | 
				
			||||||
		columns[i] = column
 | 
							columns[i] = column
 | 
				
			||||||
| 
						 | 
					@ -890,11 +891,13 @@ local function archetype_create(world: world, id_types: { i53 }, ty, prev: i53?)
 | 
				
			||||||
			local object = ECS_PAIR_SECOND(component_id)
 | 
								local object = ECS_PAIR_SECOND(component_id)
 | 
				
			||||||
			local r = ECS_PAIR(relation, EcsWildcard)
 | 
								local r = ECS_PAIR(relation, EcsWildcard)
 | 
				
			||||||
			local idr_r = id_record_ensure(world, r)
 | 
								local idr_r = id_record_ensure(world, r)
 | 
				
			||||||
 | 
								idr_r.size += 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			archetype_append_to_records(idr_r, archetype_id, columns_map, r, i, column)
 | 
								archetype_append_to_records(idr_r, archetype_id, columns_map, r, i, column)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			local t = ECS_PAIR(EcsWildcard, object)
 | 
								local t = ECS_PAIR(EcsWildcard, object)
 | 
				
			||||||
			local idr_t = id_record_ensure(world, t)
 | 
								local idr_t = id_record_ensure(world, t)
 | 
				
			||||||
 | 
								idr_t.size += 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			archetype_append_to_records(idr_t, archetype_id, columns_map, t, i, column)
 | 
								archetype_append_to_records(idr_t, archetype_id, columns_map, t, i, column)
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue