1
0
mirror of https://github.com/20kdc/OC-KittenOS.git synced 2024-12-25 10:28:06 +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)
-- This is an iterator :(
local t = {}
local tk = {}
for k, v in pairs(components) do
local ok = false
if filter then
@ -110,13 +111,17 @@ vmComponent = {
end
if ok then
table.insert(t, {k, v.type})
tk[k] = v.type
end
end
return function ()
local tr1 = table.remove(t, 1)
if not tr1 then return end
return table.unpack(tr1)
end, 9, nil
setmetatable(tk, {
__call = function ()
local tr1 = table.remove(t, 1)
if not tr1 then return end
return table.unpack(tr1)
end
})
return tk
end,
invoke = function (com, me, ...)
if not components[com] then error("no component " .. com) end

View File

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