mirror of
				https://github.com/Ukendio/jecs.git
				synced 2025-11-03 18:39:19 +00:00 
			
		
		
		
	Fix dst clone
This commit is contained in:
		
							parent
							
								
									df6c568c6b
								
							
						
					
					
						commit
						74ef525092
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -733,13 +733,14 @@ local function find_archetype_with(world: ecs_world_t, node: ecs_archetype_t, id
 | 
				
			||||||
	-- them each time would be expensive. Instead this insertion sort can find the insertion
 | 
						-- them each time would be expensive. Instead this insertion sort can find the insertion
 | 
				
			||||||
	-- point in the types array.
 | 
						-- point in the types array.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	local dst = table.clone(node.types) :: { i53 }
 | 
					 | 
				
			||||||
	local at = find_insert(id_types, id)
 | 
						local at = find_insert(id_types, id)
 | 
				
			||||||
	if at == -1 then
 | 
						if at == -1 then
 | 
				
			||||||
		-- If it finds a duplicate, it just means it is the same archetype so it can return it
 | 
							-- If it finds a duplicate, it just means it is the same archetype so it can return it
 | 
				
			||||||
		-- directly instead of needing to hash types for a lookup to the archetype.
 | 
							-- directly instead of needing to hash types for a lookup to the archetype.
 | 
				
			||||||
		return node
 | 
							return node
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						local dst = table.clone(node.types) :: { i53 }
 | 
				
			||||||
	table.insert(dst, at, id)
 | 
						table.insert(dst, at, id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return archetype_ensure(world, dst)
 | 
						return archetype_ensure(world, dst)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue