mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-21 21:25:16 +00:00
Use history recording and don't do anything permanent (#915)
This commit is contained in:
@@ -112,9 +112,12 @@ end
|
||||
|
||||
function InstanceMap:destroyInstance(instance)
|
||||
local id = self.fromInstances[instance]
|
||||
|
||||
local descendants = instance:GetDescendants()
|
||||
instance:Destroy()
|
||||
|
||||
-- Because the user might want to Undo this change, we cannot use Destroy
|
||||
-- since that locks that parent and prevents ChangeHistoryService from
|
||||
-- ever bringing it back. Instead, we parent to nil.
|
||||
instance.Parent = nil
|
||||
|
||||
-- After the instance is successfully destroyed,
|
||||
-- we can remove all the id mappings
|
||||
|
||||
Reference in New Issue
Block a user