aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAuke Kok <sofar@foo-projects.org>2016-04-13 23:10:37 -0700
committerparamat <mat.gregory@virginmedia.com>2016-04-20 06:51:11 +0100
commit855a305057a8a41d1e34520c4e88845872a01d6f (patch)
tree4e803dc54f743029bb9129fde2685709a8b5c699
parentbc4dc80c0166bd5c7f645bec1472101e4a9e20bb (diff)
downloadminetest-855a305057a8a41d1e34520c4e88845872a01d6f.tar.gz
minetest-855a305057a8a41d1e34520c4e88845872a01d6f.tar.bz2
minetest-855a305057a8a41d1e34520c4e88845872a01d6f.zip
falling: walk 4 additional diagonally down directions.
This seems very little cost and matches the old behavior more closely. This will cause some more falling nodes to get added to falling clusters. With the efficiency of the algorithm, this really doesn't do much damage.
-rw-r--r--builtin/game/falling.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/game/falling.lua b/builtin/game/falling.lua
index cce8d4bf4..57bb98cfd 100644
--- a/builtin/game/falling.lua
+++ b/builtin/game/falling.lua
@@ -182,6 +182,10 @@ end
-- Down first as likely case, but always before self. The same with sides.
-- Up must come last, so that things above self will also fall all at once.
local nodeupdate_neighbors = {
+ {x = -1, y = -1, z = 0},
+ {x = 1, y = -1, z = 0},
+ {x = 0, y = -1, z = -1},
+ {x = 0, y = -1, z = 1},
{x = 0, y = -1, z = 0},
{x = -1, y = 0, z = 0},
{x = 1, y = 0, z = 0},
@@ -226,10 +230,10 @@ function nodeupdate(p)
n = n - 1
-- If there's nothing left on the stack, and no
-- more sides to walk to, we're done and can exit
- if n == 0 and v == 7 then
+ if n == 0 and v == 11 then
return
end
- until v < 7
+ until v < 11
-- The next round walk the next neighbor in list.
v = v + 1
else