summaryrefslogtreecommitdiff
path: root/src/environment.cpp
diff options
context:
space:
mode:
authorLars Hofhansl <larsh@apache.org>2016-12-10 10:31:17 -0800
committerparamat <mat.gregory@virginmedia.com>2016-12-24 00:28:39 +0000
commit2f59a0c840e9101c87e2d59fabf34116b3328121 (patch)
tree03bc323e3ce3f718d20454af37306b5409ea6c33 /src/environment.cpp
parent923a8f1983271f65c80cbbde7c46153ce58560b4 (diff)
downloadminetest-2f59a0c840e9101c87e2d59fabf34116b3328121.tar.gz
minetest-2f59a0c840e9101c87e2d59fabf34116b3328121.tar.bz2
minetest-2f59a0c840e9101c87e2d59fabf34116b3328121.zip
Process ABMs in a spherical volume instead of cubic
Increase active_block_range default to a 3 mapblock radius.
Diffstat (limited to 'src/environment.cpp')
-rw-r--r--src/environment.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/environment.cpp b/src/environment.cpp
index 13c64b37c..3d4a2efc1 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -397,8 +397,11 @@ void fillRadiusBlock(v3s16 p0, s16 r, std::set<v3s16> &list)
for(p.Y=p0.Y-r; p.Y<=p0.Y+r; p.Y++)
for(p.Z=p0.Z-r; p.Z<=p0.Z+r; p.Z++)
{
- // Set in list
- list.insert(p);
+ // limit to a sphere
+ if (p.getDistanceFrom(p0) <= r) {
+ // Set in list
+ list.insert(p);
+ }
}
}