Skip to content
Snippets Groups Projects
Commit 1b745d40 authored by tenplus1's avatar tenplus1 Committed by paramat
Browse files

Default/trees: Faster 'is snow nearby' function

Use 'find node near' instead of 'find nodes in area'
parent 2ecbc43a
No related branches found
No related tags found
No related merge requests found
......@@ -27,10 +27,8 @@ end
-- 'is snow nearby' function
local function is_snow_nearby(pos)
return #minetest.find_nodes_in_area(
{x = pos.x - 1, y = pos.y - 1, z = pos.z - 1},
{x = pos.x + 1, y = pos.y + 1, z = pos.z + 1},
{"default:snow", "default:snowblock", "default:dirt_with_snow"}) > 0
return minetest.find_node_near(pos, 1,
{"default:snow", "default:snowblock", "default:dirt_with_snow"})
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment