Add a moremesecons_utils mod to reduce redundant code

This commit is contained in:
upsilon
2017-04-19 11:08:58 +02:00
parent b9654cca02
commit 75abcb3077
14 changed files with 49 additions and 66 deletions

View File

@ -16,12 +16,7 @@ local function remove_jammer(pos)
end
local function is_jammed(pos)
local JAMMER_MAX_DISTANCE = tonumber(minetest.setting_get("moresecons_jammer.max_distance")) or 10
if JAMMER_MAX_DISTANCE <= 0 then
JAMMER_MAX_DISTANCE = 1
elseif JAMMER_MAX_DISTANCE ~= JAMMER_MAX_DISTANCE then -- NaN
JAMMER_MAX_DISTANCE = 10
end
local JAMMER_MAX_DISTANCE = moremesecons.setting("jammer", "max_distance", 10, 1)
local pz,py,px = vector.unpack(pos)
for z,yxs in pairs(jammers) do