From 0af858e47af3cfc71bc3294f849108b5c00d0b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 8 Mar 2019 15:08:00 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/vm/vm.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'server/src/vm') diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index 50deb7e9..9e89c6e6 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -311,6 +311,7 @@ function mt:call(value, values, source) if not func then return end + self:instantSource(source) if lib then self:callLibrary(func, values, source, lib) else @@ -437,8 +438,11 @@ function mt:unpackList(list) end function mt:getFirstInMulti(multi) + if not multi then + return multi + end if multi.type == 'multi' then - return multi[1] + return self:getFirstInMulti(multi[1]) else return multi end @@ -449,6 +453,7 @@ function mt:getSimple(simple, max) local first = simple[1] self:instantSource(first) local value = self:getExp(first) + value = self:getFirstInMulti(value) or createValue('nil') first:bindValue(value, 'get') if not max then max = #simple -- cgit v1.2.3