Merge branch 'master' into modules

This commit is contained in:
Luke Miller
2021-04-23 22:17:03 -04:00
4 changed files with 90 additions and 25 deletions

View File

@@ -8,10 +8,6 @@
-- Main API table
if not modpol then modpol = {} end
-- Table for modpol data
modpol.orgs = {
}
-- Record of every state change should appear here
modpol.ledger = {
}
@@ -76,12 +72,14 @@ dofile (topdir .. "/api.lua")
-- ===================================================================
-- Final checks
-- create instance if not present
if not modpol.orgs.get_org('instance') then
modpol.orgs.init_instance()
modpol.instance = modpol.orgs.get_org('instance')
for id, org in ipairs(modpol.orgs.array) do
setmetatable(org, modpol.orgs)
end
-- create instance if not present
modpol.instance = modpol.orgs.array[1] or modpol.orgs.init_instance()
modpol.ocutil.log ("modpol loaded")
-- ===================================================================