mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 22:11:38 +00:00
Deletion, wrangling parents a little bit
This commit is contained in:
parent
8729de1312
commit
e4f35b29bd
4 changed files with 60 additions and 10 deletions
|
|
@ -21,7 +21,9 @@ function Session.new()
|
|||
|
||||
return api:readAll()
|
||||
:andThen(function(instances)
|
||||
local visited = {}
|
||||
for id, instance in pairs(instances) do
|
||||
visited[id] = true
|
||||
if id ~= "0" then
|
||||
local existing = created[id]
|
||||
if existing ~= nil then
|
||||
|
|
@ -45,6 +47,12 @@ function Session.new()
|
|||
created[id].Parent = created[tostring(instance.parent)]
|
||||
end
|
||||
end
|
||||
|
||||
for id, object in pairs(created) do
|
||||
if not visited[id] then
|
||||
object:Destroy()
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue