summaryrefslogtreecommitdiff
path: root/mesecons/settings.lua
blob: 02207073c524c54a735d8a09db52a0291cbed96b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- SETTINGS
function mesecon.setting(setting, default)
	if type(default) == "boolean" then
		local read = minetest.settings:get_bool("mesecon."..setting)
		if read == nil then
			return default
		else
			return read
		end
	elseif type(default) == "string" then
		return minetest.settings:get("mesecon."..setting) or default
	elseif type(default) == "number" then
		return tonumber(minetest.settings:get("mesecon."..setting) or default)
	end
end