diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2016-08-17 20:58:35 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2016-08-17 20:58:35 +0100 |
commit | cfe8562c7a0f8df99f54c3a6811549c6593fe011 (patch) | |
tree | a28f0031f5a98b0f29e27b8aa76647ea27d85525 /api.lua | |
parent | e2f9bbe89fe8e82815146fef32f650d0ae57463f (diff) |
added 0.4.13 compatible global check
Diffstat (limited to 'api.lua')
-rw-r--r-- | api.lua | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -1,5 +1,5 @@ --- Mobs Api (16th August 2016) +-- Mobs Api (17th August 2016) mobs = {} mobs.mod = "redo" @@ -28,10 +28,14 @@ mobs.intllib = S -- Invisibility mod ---local invis = {} ---if minetest.global_exists("invisibility") then - local invis = invisibility ---end +function check_global(name) + return rawget(_G, name) ~= nil +end + +local invis = {} +if check_global("invisibility") then + invis = invisibility +end -- Load settings local damage_enabled = minetest.setting_getbool("enable_damage") |