continue;
bool block_data_inexistent = false;
- try
{
TimeTaker timer2("emerge load", &emerge_load_time);
- block = m_map->getBlockNoCreate(p);
- if(block->isDummy())
+ block = m_map->getBlockNoCreateNoEx(p);
+ if (!block || block->isDummy())
block_data_inexistent = true;
else
block->copyTo(*this);
}
- catch(InvalidPositionException &e)
- {
- block_data_inexistent = true;
- }
if(block_data_inexistent)
{
g_settings->getU32("max_simultaneous_block_sends_per_client") / 4 + 1;
ScopeProfiler sp(g_profiler, "Server::SendBlocks(): Send to clients");
+ Map &map = m_env->getMap();
+
for (const PrioritySortedBlockTransfer &block_to_send : queue) {
if (total_sending >= max_blocks_to_send)
break;
- MapBlock *block = nullptr;
- try {
- block = m_env->getMap().getBlockNoCreate(block_to_send.pos);
- } catch (const InvalidPositionException &e) {
+ MapBlock *block = map.getBlockNoCreateNoEx(block_to_send.pos);
+ if (!block)
continue;
- }
RemoteClient *client = m_clients.lockedGetClientNoEx(block_to_send.peer_id,
CS_Active);
bool Server::SendBlock(session_t peer_id, const v3s16 &blockpos)
{
- MapBlock *block = nullptr;
- try {
- block = m_env->getMap().getBlockNoCreate(blockpos);
- } catch (InvalidPositionException &e) {};
+ MapBlock *block = m_env->getMap().getBlockNoCreateNoEx(blockpos);
if (!block)
return false;