1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add map limit config option

This commit is contained in:
rubenwardy 2015-07-13 16:01:31 +01:00 committed by est31
parent a5e5aa5be9
commit ec796b8e81
11 changed files with 38 additions and 43 deletions

View file

@ -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;
}