mirror of
				https://github.com/Ukendio/jecs.git
				synced 2025-10-31 09:09:18 +00:00 
			
		
		
		
	Should be componentId not entityId
This commit is contained in:
		
							parent
							
								
									fad2a21ac5
								
							
						
					
					
						commit
						75518fcdce
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -293,7 +293,7 @@ end | |||
| function World.add(world: World, entityId: i53, componentId: i53)  | ||||
| 	local record = ensureRecord(world.entityIndex, entityId) | ||||
| 	local from = record.archetype | ||||
| 	local to = archetypeTraverseAdd(world, entityId, from) | ||||
| 	local to = archetypeTraverseAdd(world, componentId, from) | ||||
| 	if from then | ||||
| 		moveEntity(world.entityIndex, entityId, record, to) | ||||
| 	else | ||||
|  | @ -308,7 +308,7 @@ end | |||
| function World.set(world: World, entityId: i53, componentId: i53, data: unknown)  | ||||
| 	local record = ensureRecord(world.entityIndex, entityId) | ||||
| 	local from = record.archetype | ||||
| 	local to = archetypeTraverseAdd(world, entityId, from) | ||||
| 	local to = archetypeTraverseAdd(world, componentId, from) | ||||
| 
 | ||||
| 	if from == to then  | ||||
| 		-- If the archetypes are the same it can avoid moving the entity  | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue