From c38b64f0c5cba3e75d1ba7e43c3f042410dc5058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 20 Dec 2018 21:25:24 +0800 Subject: =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=9B=B4=E5=A4=9A=E8=84=8F=E8=AF=AD?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/matcher/vm.lua | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'server') diff --git a/server/src/matcher/vm.lua b/server/src/matcher/vm.lua index b9907804..f2494432 100644 --- a/server/src/matcher/vm.lua +++ b/server/src/matcher/vm.lua @@ -1087,12 +1087,14 @@ function mt:doFunction(action) local name = action.name local var, object local source - if name.type == 'simple' then - var, object = self:getSimple(name, 'field') - source = name[#name] - else - var = self:getName(name[1], name) - source = name + if name then + if name.type == 'simple' then + var, object = self:getSimple(name, 'field') + source = name[#name] + else + var = self:getName(name[1], name) + source = name + end end local func = self:buildFunction(action, object) self:setValue(var, func, source) @@ -1100,9 +1102,19 @@ end function mt:doLocalFunction(action) local name = action.name - local var = self:createLocal(name[1], name) - local func = self:buildFunction(action) - self:setValue(var, func, name) + local var, object + local source + if name then + if name.type == 'simple' then + var, object = self:getSimple(name, 'field') + source = name[#name] + else + var = self:createLocal(name[1], name) + source = name + end + end + local func = self:buildFunction(action, object) + self:setValue(var, func, source) end function mt:doAction(action) -- cgit v1.2.3