From 6e61c7d92a91f2f9e726d3e0b9b1f21d54abe23d Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Fri, 21 Nov 2014 11:32:01 -0500 Subject: [PATCH] Add minetest.global_exists() --- builtin/common/strict.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builtin/common/strict.lua b/builtin/common/strict.lua index c353bb9..c7b8646 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