summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars <larsh@apache.org>2020-11-06 10:54:04 -0800
committerlhofhansl <larsh@apache.org>2020-11-07 08:51:10 -0800
commit8c1871fa2c066a2086988684256da97bd0f4ab6f (patch)
treeab05f1d9397e29119023bd2689a2edce70e640cb /src
parent627c22c36e32185d48d2faf8197e22cbaa4c50b2 (diff)
downloadminetest-8c1871fa2c066a2086988684256da97bd0f4ab6f.tar.gz
minetest-8c1871fa2c066a2086988684256da97bd0f4ab6f.tar.bz2
minetest-8c1871fa2c066a2086988684256da97bd0f4ab6f.zip
Revert #10495 and simplify.
Diffstat (limited to 'src')
-rw-r--r--src/clientiface.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp
index 08d5d3be7..01852c5d1 100644
--- a/src/clientiface.cpp
+++ b/src/clientiface.cpp
@@ -209,6 +209,13 @@ void RemoteClient::GetNextBlocks (
s16 d_max_gen = std::min(adjustDist(m_max_gen_distance, prop_zoom_fov),
wanted_range);
+ s16 d_max = full_d_max;
+
+ // Don't loop very much at a time
+ s16 max_d_increment_at_time = 2;
+ if (d_max > d_start + max_d_increment_at_time)
+ d_max = d_start + max_d_increment_at_time;
+
// cos(angle between velocity and camera) * |velocity|
// Limit to 0.0f in case player moves backwards.
f32 dot = rangelim(camera_dir.dotProduct(playerspeed), 0.0f, 300.0f);
@@ -225,7 +232,7 @@ void RemoteClient::GetNextBlocks (
const v3s16 cam_pos_nodes = floatToInt(camera_pos, BS);
s16 d;
- for (d = d_start; d <= full_d_max; d++) {
+ for (d = d_start; d <= d_max; d++) {
/*
Get the border/face dot coordinates of a "d-radiused"
box