Skip to content

Commit

Permalink
Use field function in fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
memorycode committed Nov 23, 2024
1 parent 34d32eb commit 5e5ecd5
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/World.luau
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5e5ecd5

Please sign in to comment.