mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Add map limit config option
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user