diff options
Diffstat (limited to 'server/src/vm/function.lua')
-rw-r--r-- | server/src/vm/function.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/server/src/vm/function.lua b/server/src/vm/function.lua index 8d45ef8e..e246509d 100644 --- a/server/src/vm/function.lua +++ b/server/src/vm/function.lua @@ -138,16 +138,16 @@ function mt:hasRuned() return self._runed > 0 end +function mt:needSkip() + return self._runed > 1 +end + function mt:run(vm) self._runed = self._runed + 1 if not self.source then return end - if self._runed > 1 then - --return - end - -- 第一次运行函数时,创建函数的参数 if self._runed == 1 then -- 如果是面向对象形式的函数,创建隐藏的参数self @@ -162,6 +162,10 @@ function mt:run(vm) self:createArgs(vm) end + if self:needSkip() then + return + end + -- 向局部变量中填充参数 for i, loc in ipairs(self.args) do loc:setValue(self.argValues[i] or createValue('nil', arg)) |