Got first token modules working, and a bunch of bugfixes throughout

This commit is contained in:
Nathan Schneider
2021-12-26 23:03:57 -07:00
parent 0c59767ef7
commit 286d131839
13 changed files with 182 additions and 19 deletions

View File

@ -1,11 +1,18 @@
modpol.util = {}
--- @function modpol.copy_table
-- @param t table
-- Returns a copy of the table inputted
function modpol.util.copy_table(t)
local t2 = {}
for k,v in pairs(t) do
t2[k] = v
if ipairs(t) then
for i,v in ipairs(t) do
t2[i] = v
end
elseif pairs(t) then
for k,v in pairs(t) do
t2[k] = v
end
end
return t2
end