1
0
mirror of https://github.com/20kdc/OC-KittenOS.git synced 2024-11-27 04:48:05 +11:00

Fix metamachine being broken due to undocumented OC component.list quirk

This commit is contained in:
20kdc 2018-05-30 16:23:19 +01:00
parent f011da9810
commit 3df5b6d3c9
2 changed files with 11 additions and 6 deletions

View File

@ -99,6 +99,7 @@ vmComponent = {
list = function (filter, exact) list = function (filter, exact)
-- This is an iterator :( -- This is an iterator :(
local t = {} local t = {}
local tk = {}
for k, v in pairs(components) do for k, v in pairs(components) do
local ok = false local ok = false
if filter then if filter then
@ -110,13 +111,17 @@ vmComponent = {
end end
if ok then if ok then
table.insert(t, {k, v.type}) table.insert(t, {k, v.type})
tk[k] = v.type
end end
end end
return function () setmetatable(tk, {
local tr1 = table.remove(t, 1) __call = function ()
if not tr1 then return end local tr1 = table.remove(t, 1)
return table.unpack(tr1) if not tr1 then return end
end, 9, nil return table.unpack(tr1)
end
})
return tk
end, end,
invoke = function (com, me, ...) invoke = function (com, me, ...)
if not components[com] then error("no component " .. com) end if not components[com] then error("no component " .. com) end

View File

@ -108,7 +108,7 @@ return {
}, },
["app-metamachine"] = { ["app-metamachine"] = {
desc = "Virtual machine", desc = "Virtual machine",
v = 0, v = 1,
deps = { deps = {
"neo", "neo",
"zzz-license-pd" "zzz-license-pd"