Check for NaN values in settings

This commit is contained in:
upsilon
2017-02-11 15:44:53 +01:00
parent d6e50086c1
commit 676baa4b0b
7 changed files with 24 additions and 8 deletions

View File

@ -19,6 +19,8 @@ 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 pz,py,px = vector.unpack(pos)