Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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'.
  • Loading branch information
lhofhansl authored and paramat committed Nov 8, 2016
1 parent 2b21cac commit e7c62ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/clientiface.cpp
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit e7c62ed

Please sign in to comment.