Skip to content

Commit e7c62ed

Browse files
lhofhanslparamat
authored andcommittedNov 8, 2016
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'.
1 parent 2b21cac commit e7c62ed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

Diff for: ‎src/clientiface.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ void RemoteClient::GetNextBlocks (
175175

176176
const s16 full_d_max = g_settings->getS16("max_block_send_distance");
177177
const s16 d_opt = g_settings->getS16("block_send_optimize_distance");
178+
const s16 d_blocks_in_sight = (full_d_max + 1) * BS * MAP_BLOCKSIZE;
178179

179180
s16 d_max = full_d_max;
180181
s16 d_max_gen = g_settings->getS16("max_block_generate_distance");
@@ -242,7 +243,7 @@ void RemoteClient::GetNextBlocks (
242243
*/
243244

244245
float camera_fov = (72.0*M_PI/180) * 4./3.;
245-
if(isBlockInSight(p, camera_pos, camera_dir, camera_fov, 10000*BS) == false)
246+
if(isBlockInSight(p, camera_pos, camera_dir, camera_fov, d_blocks_in_sight) == false)
246247
{
247248
continue;
248249
}

0 commit comments

Comments
 (0)
Please sign in to comment.