1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-26 02:30:38 +01:00

More global vars

This commit is contained in:
LeMagnesium 2015-01-15 22:45:27 +01:00
parent ae4295babc
commit 42885ee458

View File

@ -252,14 +252,14 @@ end
local atleast_nodes_in_grid = function(pos, search_distance, height, node_name, threshold) local atleast_nodes_in_grid = function(pos, search_distance, height, node_name, threshold)
counter = counter +1 counter = counter +1
-- minetest.chat_send_all("counter: (" .. counter .. ")") -- minetest.chat_send_all("counter: (" .. counter .. ")")
minp = {x=pos.x-search_distance,y=height, z=pos.z+20} local minp = {x=pos.x-search_distance,y=height, z=pos.z+20}
maxp = {x=pos.x+search_distance,y=height, z=pos.z+20} local maxp = {x=pos.x+search_distance,y=height, z=pos.z+20}
nodes = minetest.find_nodes_in_area(minp, maxp, node_name) local nodes = minetest.find_nodes_in_area(minp, maxp, node_name)
-- minetest.chat_send_all("z+Found (" .. node_name .. ": " .. #nodes .. ")") -- minetest.chat_send_all("z+Found (" .. node_name .. ": " .. #nodes .. ")")
if #nodes >= threshold then if #nodes >= threshold then
return true return true
end end
totalnodes = #nodes local totalnodes = #nodes
minp = {x=pos.x-search_distance,y=height, z=pos.z-20} minp = {x=pos.x-search_distance,y=height, z=pos.z-20}
maxp = {x=pos.x+search_distance,y=height, z=pos.z-20} maxp = {x=pos.x+search_distance,y=height, z=pos.z-20}
nodes = minetest.find_nodes_in_area(minp, maxp, node_name) nodes = minetest.find_nodes_in_area(minp, maxp, node_name)