bug fixes: orgs load properly (metatable set), orgs can't have same name, orgs now saved on modifying operations

This commit is contained in:
Luke Miller
2021-04-16 20:27:31 -04:00
parent 6bc5f4077e
commit cff1d393c0
3 changed files with 28 additions and 13 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 = {
}
@@ -77,10 +73,8 @@ 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')
end
modpol.instance = modpol.orgs.array[1] or modpol.orgs.init_instance()
modpol.ocutil.log ("modpol loaded")