From 06056db301b47147fa9f200eac97a4fb941ce4a1 Mon Sep 17 00:00:00 2001 From: proller Date: Sun, 25 Aug 2024 03:11:26 +0200 Subject: [PATCH] wip --- src/defaultsettings.cpp | 2 +- src/fm_clientiface.cpp | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index f091b32cd..04a2098b6 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -388,7 +388,7 @@ void fm_set_default_settings(Settings *settings) { #endif #ifdef __EMSCRIPTEN__ - settings->setDefault("viewing_range", "500"); + settings->setDefault("viewing_range", "100"); settings->setDefault("client_mesh_chunk", "4"); #endif diff --git a/src/fm_clientiface.cpp b/src/fm_clientiface.cpp index 2aa7a3f19..06b661366 100644 --- a/src/fm_clientiface.cpp +++ b/src/fm_clientiface.cpp @@ -377,9 +377,21 @@ int RemoteClient::GetNextBlocks(ServerEnvironment *env, EmergeManager *emerge, // bool surely_not_found_on_disk = false; // bool block_is_invalid = false; if (block) { - if (d > 2 && block->content_only == CONTENT_AIR) { + uint8_t not_air = 0; + for (const auto &dir : g_6dirs) { + if (const auto *block_near = + env->getMap().getBlockNoCreateNoEx(p + dir)) { + if (block_near->content_only && + block_near->content_only != CONTENT_AIR) { + ++not_air; + break; + } + } + } + if (!not_air) { continue; + } } if (block_sent > 0 && block_sent >= block->m_changed_timestamp) {