From 42885ee458b0a1613ced21068f52e0125f7071ef Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Thu, 15 Jan 2015 22:45:27 +0100 Subject: [PATCH] More global vars --- mods/ambience_modpack/ambience/init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/ambience_modpack/ambience/init.lua b/mods/ambience_modpack/ambience/init.lua index 3a14d97d..64545c8a 100755 --- a/mods/ambience_modpack/ambience/init.lua +++ b/mods/ambience_modpack/ambience/init.lua @@ -252,14 +252,14 @@ end local atleast_nodes_in_grid = function(pos, search_distance, height, node_name, threshold) counter = counter +1 -- minetest.chat_send_all("counter: (" .. counter .. ")") - minp = {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) + local minp = {x=pos.x-search_distance,y=height, z=pos.z+20} + local maxp = {x=pos.x+search_distance,y=height, z=pos.z+20} + local nodes = minetest.find_nodes_in_area(minp, maxp, node_name) -- minetest.chat_send_all("z+Found (" .. node_name .. ": " .. #nodes .. ")") if #nodes >= threshold then return true end - totalnodes = #nodes + local totalnodes = #nodes minp = {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)