mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-25 15:16:07 +00:00
Add InstanceMap:destroyInstance for forgetting and destroying in one step
This commit is contained in:
@@ -45,6 +45,16 @@ function InstanceMap:removeInstance(instance)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function InstanceMap:destroyInstance(instance)
|
||||||
|
local id = self.fromInstances[instance]
|
||||||
|
|
||||||
|
if id ~= nil then
|
||||||
|
self:destroyId(id)
|
||||||
|
else
|
||||||
|
Logging.warn("Attempted to destroy untracked instance %s", tostring(instance))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function InstanceMap:destroyId(id)
|
function InstanceMap:destroyId(id)
|
||||||
local instance = self.fromIds[id]
|
local instance = self.fromIds[id]
|
||||||
self:removeId(id)
|
self:removeId(id)
|
||||||
|
|||||||
Reference in New Issue
Block a user