aboutsummaryrefslogtreecommitdiff
path: root/src/utils.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.lua')
-rw-r--r--src/utils.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utils.lua b/src/utils.lua
index b2186cc..29c3024 100644
--- a/src/utils.lua
+++ b/src/utils.lua
@@ -92,3 +92,10 @@ function rotate_vec(x, y, r)
return math.cos(angle) * len, math.sin(angle) * len
end
+function table.shallow_copy(t)
+ local t2 = {}
+ for k,v in pairs(t) do
+ t2[k] = v
+ end
+ return t2
+end