diff options
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/vm/getClass.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/script-beta/vm/getClass.lua b/script-beta/vm/getClass.lua index 295ffae3..c4bde74a 100644 --- a/script-beta/vm/getClass.lua +++ b/script-beta/vm/getClass.lua @@ -16,12 +16,31 @@ local function getClass(source, classes, deep) end end end) + if source.value then + vm.eachField(source.value, function (src) + local key = vm.getKeyName(src) + local lkey = key:lower() + if lkey == 's|type' + or lkey == 's|__name' + or lkey == 's|name' + or lkey == 's|class' then + if src.value and src.value.type == 'string' then + classes[#classes+1] = src.value[1] + end + end + end) + end if #classes ~= 0 then return end vm.eachMeta(source, function (mt) getClass(mt, classes, deep + 1) end) + if source.value then + vm.eachMeta(source.value, function (mt) + getClass(mt, classes, deep + 1) + end) + end end function vm.getClass(source) |