diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/vm/global.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/script/vm/global.lua b/script/vm/global.lua index 6db3a58c..6f3bcb68 100644 --- a/script/vm/global.lua +++ b/script/vm/global.lua @@ -374,9 +374,18 @@ local compilerGlobalSwitch = util.switch() end source._enums = {} for _, field in ipairs(tbl) do - if field.type == 'tablefield' - or field.type == 'tableindex' then + if field.type == 'tablefield' then source._enums[#source._enums+1] = field + local subType = vm.declareGlobal('type', name .. '.' .. field.field[1], uri) + subType:addSet(uri, field) + field._globalNode = subType + elseif field.type == 'tableindex' then + source._enums[#source._enums+1] = field + if field.index.type == 'string' then + local subType = vm.declareGlobal('type', name .. '.' .. field.index[1], uri) + subType:addSet(uri, field) + field._globalNode = subType + end end end end) |