Skip to content

Commit

Permalink
Transition entity for each removed component
Browse files Browse the repository at this point in the history
  • Loading branch information
memorycode committed Nov 22, 2024
1 parent d9b2fbb commit 21b118b
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lib/World.luau
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ local function executeRemove(world: World, removeCommand: RemoveCommand)
local entityRecord = ensureRecord(world, entityId)
local archetype = entityRecord.archetype

local didRemove = false
for _, component in removeCommand.components do
local componentId = #component
local fieldIndex = archetype.idToIndex[componentId]
Expand All @@ -387,11 +386,7 @@ local function executeRemove(world: World, removeCommand: RemoveCommand)
archetype = nextArchetype
end

didRemove = true
world:_trackChanged(component, entityId, componentInstance, nil)
end

if didRemove then
transitionArchetype(world, entityId, entityRecord, archetype)
end
end
Expand Down

0 comments on commit 21b118b

Please sign in to comment.