Improve a bit the code...

..., remove one deprecated function, use mod.conf for name and description.
This commit is contained in:
Panquesito7
2019-09-26 16:44:19 -05:00
parent 124bdb7401
commit 1a36d6a7d5
3 changed files with 11 additions and 4 deletions

View File

@ -11,12 +11,14 @@ function thismod.mklog(level, modname)
minetest.log(level, "[" .. modname .. "] " .. str)
end
end
local LogI = thismod.mklog('action', modname)
local LogE = thismod.mklog('error', modname)
local singleplayer = minetest.is_singleplayer() -- Caching is OK since you can't open a game to
-- multiplayer unless you restart it.
if minetest.setting_get(modname .. '.enable_singleplayer') ~= 'true' and singleplayer then
if minetest.settings:get(modname .. '.enable_singleplayer') ~= 'true' and singleplayer then
LogI("Not enabling because of singleplayer game")
return
end
@ -202,6 +204,7 @@ local function ping()
end
minetest.after(1800, ping)
end
minetest.after(10, ping)
local shutdown_callbacks = {}
@ -229,4 +232,4 @@ function thismod.table_exists(name)
return exists
end
dofile(modpath .. '/abstraction.lua')
dofile(modpath .. '/abstraction.lua')