diff options
author | Lars Hofhansl <larsh@apache.org> | 2016-11-04 00:14:07 -0700 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2016-11-08 15:15:27 +0000 |
commit | e7c62edec90c476b54ea7cf7c44354f1609e4575 (patch) | |
tree | 5defbacccde939f6168ba468dae4c102318a01d6 /src | |
parent | 2b21cac1d80454bd23c5f60c4570b30edba62584 (diff) | |
download | minetest-e7c62edec90c476b54ea7cf7c44354f1609e4575.tar.gz minetest-e7c62edec90c476b54ea7cf7c44354f1609e4575.tar.bz2 minetest-e7c62edec90c476b54ea7cf7c44354f1609e4575.zip |
Retrieve mapblocks from the server in a sphere, not a cube
Use unused range argument in 'isBlockInSight()' to limit mapblock sends
to a sphere of radius 'max block send distance'.
Diffstat (limited to 'src')
-rw-r--r-- | src/clientiface.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp index 4b9efcb49..7e75c69a4 100644 --- a/src/clientiface.cpp +++ b/src/clientiface.cpp @@ -175,6 +175,7 @@ void RemoteClient::GetNextBlocks ( const s16 full_d_max = g_settings->getS16("max_block_send_distance"); const s16 d_opt = g_settings->getS16("block_send_optimize_distance"); + const s16 d_blocks_in_sight = (full_d_max + 1) * BS * MAP_BLOCKSIZE; s16 d_max = full_d_max; s16 d_max_gen = g_settings->getS16("max_block_generate_distance"); @@ -242,7 +243,7 @@ void RemoteClient::GetNextBlocks ( */ float camera_fov = (72.0*M_PI/180) * 4./3.; - if(isBlockInSight(p, camera_pos, camera_dir, camera_fov, 10000*BS) == false) + if(isBlockInSight(p, camera_pos, camera_dir, camera_fov, d_blocks_in_sight) == false) { continue; } |