From 387057b3c60cff77b4e2a105cfcca405422df967 Mon Sep 17 00:00:00 2001 From: darkrose Date: Sat, 6 Jun 2015 19:40:37 +1000 Subject: [PATCH] fast block ack --- src/client.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index 31e2814..b4b0672 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -174,20 +174,27 @@ void * MeshUpdateThread::Thread() }else{ MapBlock *block = m_env->getMap().getBlockNoCreateNoEx(q->p); if (block && block->mesh) { - block->mesh->generate(q->data, m_camera_offset, &block->mesh_mutex); if (q->ack_block_to_server) { MeshUpdateResult r; r.p = q->p; r.mesh = NULL; - r.ack_block_to_server = q->ack_block_to_server; + r.ack_block_to_server = true; m_queue_out.push_back(r); } + block->mesh->generate(q->data, m_camera_offset, &block->mesh_mutex); }else if (block) { + if (q->ack_block_to_server) { + MeshUpdateResult r; + r.p = q->p; + r.mesh = NULL; + r.ack_block_to_server = true; + m_queue_out.push_back(r); + } MapBlockMesh *mesh_new = new MapBlockMesh(q->data, m_camera_offset); MeshUpdateResult r; r.p = q->p; r.mesh = mesh_new; - r.ack_block_to_server = q->ack_block_to_server; + r.ack_block_to_server = false; m_queue_out.push_back(r); }