diff options
Diffstat (limited to 'server/src/vm/value.lua')
-rw-r--r-- | server/src/vm/value.lua | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua index 35f92b5d..872e96b6 100644 --- a/server/src/vm/value.lua +++ b/server/src/vm/value.lua @@ -96,8 +96,9 @@ function mt:rawSet(index, value, source) self._child = {} end if self._child[index] then - self._child[index]:mergeValue(value) - --self._child[index] = value + --self._child[index]:mergeValue(value) + self._child[index]:mergeType(value) + self._child[index] = value else self._child[index] = value end @@ -262,6 +263,21 @@ function mt:eachChild(callback, mark, foundIndex) return method:eachChild(callback, mark, foundIndex) end +function mt:mergeType(value) + if self == value then + return + end + if not value then + return + end + if value._type then + for tp, rate in pairs(value._type) do + self:setType(tp, rate) + end + end + value._type = self._type +end + function mt:mergeValue(value) if self == value then return |