From ec796b8e814864b433aea75119c307f44b2b33e8 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 13 Jul 2015 16:01:31 +0100 Subject: Add map limit config option --- src/clientiface.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/clientiface.cpp') diff --git a/src/clientiface.cpp b/src/clientiface.cpp index 6944e56db..3330e0af9 100644 --- a/src/clientiface.cpp +++ b/src/clientiface.cpp @@ -209,25 +209,19 @@ void RemoteClient::GetNextBlocks ( max_simul_dynamic = max_simul_sends_setting; // Don't select too many blocks for sending - if(num_blocks_selected >= max_simul_dynamic) - { + if (num_blocks_selected >= max_simul_dynamic) { //queue_is_full = true; goto queue_full_break; } // Don't send blocks that are currently being transferred - if(m_blocks_sending.find(p) != m_blocks_sending.end()) + if (m_blocks_sending.find(p) != m_blocks_sending.end()) continue; /* Do not go over-limit */ - if(p.X < -MAP_GENERATION_LIMIT / MAP_BLOCKSIZE - || p.X > MAP_GENERATION_LIMIT / MAP_BLOCKSIZE - || p.Y < -MAP_GENERATION_LIMIT / MAP_BLOCKSIZE - || p.Y > MAP_GENERATION_LIMIT / MAP_BLOCKSIZE - || p.Z < -MAP_GENERATION_LIMIT / MAP_BLOCKSIZE - || p.Z > MAP_GENERATION_LIMIT / MAP_BLOCKSIZE) + if (blockpos_over_limit(p)) continue; // If this is true, inexistent block will be made from scratch @@ -239,7 +233,7 @@ void RemoteClient::GetNextBlocks ( generate = false;*/ // Limit the send area vertically to 1/2 - if(abs(p.Y - center.Y) > full_d_max / 2) + if (abs(p.Y - center.Y) > full_d_max / 2) continue; } -- cgit v1.2.3