projects
/
oweals
/
minetest_game.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ecbc43
)
Default/trees: Faster 'is snow nearby' function
author
tenplus1
<tenplus1@users.noreply.github.com>
Wed, 10 Aug 2016 13:03:18 +0000
(14:03 +0100)
committer
paramat
<mat.gregory@virginmedia.com>
Mon, 15 Aug 2016 19:43:19 +0000
(20:43 +0100)
Use 'find node near' instead of 'find nodes in area'
mods/default/trees.lua
patch
|
blob
|
history
diff --git
a/mods/default/trees.lua
b/mods/default/trees.lua
index 7df35666515a4d868f1e7957165aeb1b35385603..5cd7e156ae65df6f13cbd36f08422bc611a9ff32 100644
(file)
--- a/
mods/default/trees.lua
+++ b/
mods/default/trees.lua
@@
-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