From 436cb468e9a832d15009d527d80c8dfe86bb2772 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Fri, 21 Nov 2014 11:32:01 -0500 Subject: Add minetest.global_exists() --- builtin/common/strict.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'builtin/common') 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 -- cgit v1.2.3