diff options
Diffstat (limited to 'server/src/core/global.lua')
-rw-r--r-- | server/src/core/global.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/src/core/global.lua b/server/src/core/global.lua index 8aa801de..5704bfd4 100644 --- a/server/src/core/global.lua +++ b/server/src/core/global.lua @@ -26,6 +26,7 @@ end function mt:compileVM(uri, vm) self:clearGlobal(uri) + local seted = {} for k, v in next, vm.env.child do local get, set for _, info in ipairs(v) do @@ -37,10 +38,24 @@ function mt:compileVM(uri, vm) end if set then self:markSet(uri, k, v) + seted[#seted+1] = k elseif get then self:markGet(uri, k) end end + + local needReCompile = {} + for otherUri, gets in pairs(self.get) do + for _, key in ipairs(seted) do + if gets[key] ~= nil then + needReCompile[#needReCompile+1] = otherUri + goto CONTINUE + end + end + ::CONTINUE:: + end + + return needReCompile end function mt:getGlobal(key) |