aboutsummaryrefslogtreecommitdiff
path: root/builtin/common
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-11-21 11:32:01 -0500
committerest31 <MTest31@outlook.com>2015-04-21 22:58:37 +0200
commit436cb468e9a832d15009d527d80c8dfe86bb2772 (patch)
tree1d0b163530902939b61902d393032a07482087ef /builtin/common
parent943c6e523e64dd879b7974b7adc35153095fd80e (diff)
downloadminetest-436cb468e9a832d15009d527d80c8dfe86bb2772.tar.gz
minetest-436cb468e9a832d15009d527d80c8dfe86bb2772.tar.bz2
minetest-436cb468e9a832d15009d527d80c8dfe86bb2772.zip
Add minetest.global_exists()
Diffstat (limited to 'builtin/common')
-rw-r--r--builtin/common/strict.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/common/strict.lua b/builtin/common/strict.lua
index c353bb913..c7b86461f 100644
--- a/builtin/common/strict.lua
+++ b/builtin/common/strict.lua
@@ -4,6 +4,11 @@
local WARN_INIT = false
+function core.global_exists(name)
+ return rawget(_G, name) ~= nil
+end
+
+
local function warn(message)
print(os.date("%H:%M:%S: WARNING: ")..message)
end