diff options
Diffstat (limited to 'server/src/vm/function.lua')
-rw-r--r-- | server/src/vm/function.lua | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/server/src/vm/function.lua b/server/src/vm/function.lua index 8f7ac6c2..b6772cd1 100644 --- a/server/src/vm/function.lua +++ b/server/src/vm/function.lua @@ -162,8 +162,11 @@ function mt:rawSetReturn(index, value) end function mt:setReturn(index, value) - if self._emmyReturns then - return + local emmy = self._emmyReturns and self._emmyReturns[index] + if emmy then + if emmy:bindType() or emmy:bindGeneric() then + return + end end return self:rawSetReturn(index, value) end @@ -172,8 +175,11 @@ function mt:mergeReturn(index, value) if self._removed then return end - if self._emmyReturns then - return + local emmy = self._emmyReturns and self._emmyReturns[index] + if emmy then + if emmy:bindType() or emmy:bindGeneric() then + return + end end self:set('hasReturn', true) if not self.returns then @@ -339,6 +345,15 @@ function mt:run(vm) end end +function mt:eachEmmyReturn(callback) + if not self._emmyReturns then + return + end + for _, rtn in ipairs(self._emmyReturns) do + callback(rtn) + end +end + function mt:setArgs(values) for i = 1, #self.argValues do self.argValues[i] = nil |