diff options
Diffstat (limited to 'crawl-ref/source/dat/clua/util.lua')
-rw-r--r-- | crawl-ref/source/dat/clua/util.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/dat/clua/util.lua b/crawl-ref/source/dat/clua/util.lua index 1ed3670172..5ef063d9fb 100644 --- a/crawl-ref/source/dat/clua/util.lua +++ b/crawl-ref/source/dat/clua/util.lua @@ -326,3 +326,11 @@ function util.copy_table(object) return _copy(object) end +-- Initialises a namespace that has functions spread across multiple files. +-- If the namespace table does not exist, it is created. If it already exists, +-- it is not modified. +function util.namespace(table_name) + if _G[table_name] == nil then + _G[table_name] = { } + end +end
\ No newline at end of file |