mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-09-01 11:53:57 -04:00
Fixed entities not being added to pools in some scenarios
This commit is contained in:
parent
af16e5a2d9
commit
6caf99afb4
3 changed files with 8 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
local Concord = require("concord").init({
|
||||
local Concord = require("init").init({
|
||||
useEvents = true
|
||||
})
|
||||
local Entity = Concord.entity
|
||||
|
|
|
@ -118,6 +118,13 @@ function Instance:addSystem(system, eventName, callback, enabled)
|
|||
}
|
||||
end
|
||||
|
||||
local e
|
||||
for i = 1, self.entities.size do
|
||||
e = self.entities:get(i)
|
||||
|
||||
self:checkEntity(e)
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
|
|
@ -79,14 +79,10 @@ function System:__check(e)
|
|||
pool:add(e)
|
||||
self:entityAddedTo(e, pool)
|
||||
self:__tryAdd(e)
|
||||
|
||||
return true
|
||||
elseif poolHas and not eligible then
|
||||
pool:remove(e)
|
||||
self:entityRemovedFrom(e, pool)
|
||||
self:__tryRemove(e)
|
||||
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue