mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-12-07 05:34:55 -05:00
Fixed removed list not being cleared
After an entity has a component removed from it, the apply function wasn't removing it from the removed list.
This had weird side-effects like the inability to readd components after they were removed.
For example:
entity:give(Foo):apply()
entity:remove(Foo):apply()
entity:give(Foo):apply() -- This line would fail to add the Foo component again.
This commit is contained in:
parent
54af717df8
commit
de35fdc450
1 changed files with 1 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ function Entity:apply()
|
|||
|
||||
for component, _ in pairs(self.removed) do
|
||||
self.components[component] = nil
|
||||
self.removed[component] = nil
|
||||
end
|
||||
|
||||
return self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue