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

@ -1,10 +1,5 @@
local kill_nearest_player = function(pos)
local MAX_DISTANCE = tonumber(minetest.setting_get("moremesecons_playerkiller.max_distance")) or 8 -- Use this number to set maximal distance to kill
if MAX_DISTANCE <= 0 then
MAX_DISTANCE = 8
elseif MAX_DISTANCE ~= MAX_DISTANCE then -- NaN
MAX_DISTANCE = 8
end
local MAX_DISTANCE = moremesecons.setting("playerkiller", "max_distance", 8, 1)
-- Search the nearest player
local nearest