added 0.4.13 compatible global check

master
TenPlus1 2016-08-17 20:58:35 +01:00
parent e2f9bbe89f
commit cfe8562c7a
1 changed files with 9 additions and 5 deletions

14
api.lua
View File

@ -1,5 +1,5 @@
-- Mobs Api (16th August 2016) -- Mobs Api (17th August 2016)
mobs = {} mobs = {}
mobs.mod = "redo" mobs.mod = "redo"
@ -28,10 +28,14 @@ mobs.intllib = S
-- Invisibility mod -- Invisibility mod
--local invis = {} function check_global(name)
--if minetest.global_exists("invisibility") then return rawget(_G, name) ~= nil
local invis = invisibility end
--end
local invis = {}
if check_global("invisibility") then
invis = invisibility
end
-- Load settings -- Load settings
local damage_enabled = minetest.setting_getbool("enable_damage") local damage_enabled = minetest.setting_getbool("enable_damage")