Fix 'tiny.add' and 'tiny.remove' iterating nil values.

This commit is contained in:
bakpakin
2015-05-05 22:21:39 +08:00
parent 153f326612
commit 808407f7c4
+4
View File
@@ -391,12 +391,14 @@ function tiny.add(world, ...)
local obj
for i = 1, select("#", ...) do
obj = select(i, ...)
if obj then
if isSystem(obj) then
tiny_addSystem(world, obj)
else -- Assume obj is an Entity
tiny_addEntity(world, obj)
end
end
end
end
tiny_add = tiny.add
@@ -427,12 +429,14 @@ function tiny.remove(world, ...)
local obj
for i = 1, select("#", ...) do
obj = select(i, ...)
if obj then
if isSystem(obj) then
tiny_removeSystem(world, obj)
else -- Assume obj is an Entity
tiny_removeEntity(world, obj)
end
end
end
end
tiny_remove = tiny.remove