summaryrefslogtreecommitdiff
path: root/server/src/vm
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/vm')
-rw-r--r--server/src/vm/local.lua9
-rw-r--r--server/src/vm/vm.lua4
2 files changed, 3 insertions, 10 deletions
diff --git a/server/src/vm/local.lua b/server/src/vm/local.lua
index 8f9ee3e4..cada88af 100644
--- a/server/src/vm/local.lua
+++ b/server/src/vm/local.lua
@@ -21,14 +21,6 @@ function mt:getValue()
return self.value
end
-function mt:setInitValue(value)
- self.initValue = value
-end
-
-function mt:getInitValue()
- return self.initValue
-end
-
function mt:addInfo(tp, source)
if not source then
error('No source')
@@ -157,7 +149,6 @@ return function (name, source, value)
name = name,
source = id,
value = value,
- initValue = value,
_info = {},
}, mt)
return self
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua
index 093122e4..9fcd57ae 100644
--- a/server/src/vm/vm.lua
+++ b/server/src/vm/vm.lua
@@ -40,6 +40,7 @@ function mt:buildTable(source)
if obj.type == 'pair' then
local value = self:getFirstInMulti(self:getExp(obj[2]))
local key = obj[1]
+ self:instantSource(obj)
self:instantSource(key)
key:bindValue(value, 'set')
if key.index then
@@ -794,6 +795,7 @@ function mt:doSet(action)
if not action[2] then
return
end
+ self:instantSource(action)
-- 要先计算值
local vars = action[1]
local exps = action[2]
@@ -814,6 +816,7 @@ function mt:doSet(action)
end
function mt:doLocal(action)
+ self:instantSource(action)
local vars = action[1]
local exps = action[2]
local values
@@ -966,7 +969,6 @@ function mt:doLocalFunction(action)
local func = self:buildFunction(action)
func:addInfo('local', name)
loc:setValue(func)
- loc:setInitValue(func)
end
end
end