From 75518fcdce15e349d189d9835d5f3947b17d6a4c Mon Sep 17 00:00:00 2001 From: Ukendio Date: Sat, 4 May 2024 15:52:39 +0200 Subject: [PATCH] Should be componentId not entityId --- lib/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/init.lua b/lib/init.lua index d88e354..83deb52 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -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