Add a settingtypes.txt file

This commit is contained in:
upsilon
2017-02-11 14:01:20 +01:00
parent b341335d3b
commit 795146a83e
7 changed files with 113 additions and 22 deletions

View File

@ -1,5 +1,3 @@
local JAMMER_MAX_DISTANCE = 15
local wireless = {}
local wireless_rids = {}
@ -116,6 +114,11 @@ end
-- looks big, but should work fast
function is_jammed(pos)
local JAMMER_MAX_DISTANCE = tonumber(minetest.setting_get("moremesecons_wireless.jammer_max_distance")) or 15
if JAMMER_MAX_DISTANCE <= 0 then
JAMMER_MAX_DISTANCE = 1
end
local pz,py,px = vector.unpack(pos)
for z,yxs in pairs(jammers) do
if math.abs(pz-z) <= JAMMER_MAX_DISTANCE then