1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-12 12:45:28 +01:00

Tune "block send throttling while building" optimization (#16614)

it can lead to terrain not loading/updating at all if you're constantly building and moving.

for more see the IRC logs <https://irc.luanti.org/luanti/2025-10-26#i_6293100>
This commit is contained in:
sfan5
2025-11-04 11:44:49 +01:00
committed by GitHub
parent 8350fb734a
commit 7a6e639d61
5 changed files with 29 additions and 30 deletions

View File

@@ -1173,11 +1173,6 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
std::optional<ItemStack> selected_item;
getWieldedItem(playersao, selected_item);
// Reset build time counter
if (pointed.type == POINTEDTHING_NODE &&
selected_item->getDefinition(m_itemdef).type == ITEM_NODE)
getClient(peer_id)->m_time_from_building = 0.0;
const bool had_prediction = !selected_item->getDefinition(m_itemdef).
node_placement_prediction.empty();
@@ -1214,6 +1209,8 @@ void Server::handleCommand_Interact(NetworkPacket *pkt)
if (pointed.type != POINTEDTHING_NODE)
return;
getClient(peer_id)->m_time_from_building = 0;
// If item has node placement prediction, always send the
// blocks to make sure the client knows what exactly happened
RemoteClient *client = getClient(peer_id);