From 5e5ecd5d0636974f827d738def1ba9765d4f555d Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 23 Nov 2024 13:08:29 -0500 Subject: [PATCH] Use field function in fallback --- lib/World.luau | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/World.luau b/lib/World.luau index 3b0df7c..e6d5617 100644 --- a/lib/World.luau +++ b/lib/World.luau @@ -591,14 +591,7 @@ function World:get(entityId: EntityId, ...: Component) local component = select(i, ...) assertValidComponent(component, i) - -- Does this component belong to the archetype that this entity is in? - local storageIndex = idToIndex[component.id] - if storageIndex == nil then - continue - end - - -- Yes - componentInstances[i] = archetype.fields[storageIndex][entityRecord.indexInArchetype] + componentInstances[i] = field(entityRecord, archetype, idToIndex, component) end return unpack(componentInstances, 1, length)