From 18694a6c3453206c453c41c0da0bcf4e4d62c8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 26 Feb 2019 17:03:58 +0800 Subject: =?UTF-8?q?=E5=87=BD=E6=95=B0=E8=AE=BE=E7=BD=AE=E5=88=B0=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E4=B8=AAsource=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/vm/vm.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'server/src') diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index 32bc3bc2..d8905538 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -854,8 +854,10 @@ function mt:doFunction(action) local parent = self:getSimple(name, -2) if name[#name-1].type == ':' then local value = self:buildFunction(action) - local index = self:getIndex(name[#name]) + local source = name[#name] + local index = self:getIndex(source) parent:setChild(index, value) + source:bindValue(value, 'set') local func = value:getFunction() if #name == 3 then @@ -871,12 +873,15 @@ function mt:doFunction(action) end else local value = self:buildFunction(action) - local index = self:getIndex(name[#name]) + local source = name[#name] + local index = self:getIndex(source) parent:setChild(index, value) + source:bindValue(value, 'set') end else local value = self:buildFunction(action) - self:setName(name[1], action, value) + self:setName(name[1], name, value) + name:bindValue(value, 'set') end else self:buildFunction(action) -- cgit v1.2.3