summaryrefslogtreecommitdiff
path: root/server/src/vm/source.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/vm/source.lua')
-rw-r--r--server/src/vm/source.lua17
1 files changed, 14 insertions, 3 deletions
diff --git a/server/src/vm/source.lua b/server/src/vm/source.lua
index d53019c7..8f65da8b 100644
--- a/server/src/vm/source.lua
+++ b/server/src/vm/source.lua
@@ -1,6 +1,8 @@
local mt = {}
mt.__index = mt
-mt._hasInstant = true
+
+local Id = 0
+local List = {}
function mt:bindLocal(loc, action)
if loc then
@@ -87,16 +89,25 @@ function mt:kill()
self._bindCall = nil
self._bindFunction = nil
self._bindCallArgs = nil
+ List[self.id] = nil
end
function mt:isDead()
return self._dead
end
-return function (vm, source)
- if source._hasInstant then
+local function instant(vm, source)
+ if source.id then
return false
end
+ Id = Id + 1
+ source.id = Id
+ List[Id] = source
setmetatable(source, mt)
return true
end
+
+return {
+ instant = instant,
+ list = List,
+}