From faf53ad5c9ccd0746a4fa70437c67258cbdb9ac4 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Thu, 9 May 2019 19:38:37 +0100 Subject: [PATCH] Temporary networking issue fix Former-commit-id: e6b47f7d8478c28d837e55b85f2f2d028e988737 --- client/src/lib.rs | 5 +++-- server/src/lib.rs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client/src/lib.rs b/client/src/lib.rs index b3de584492..2d73602fc3 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -212,12 +212,13 @@ impl Client { } // Request chunks from the server - for i in chunk_pos.x - 3..chunk_pos.x + 4 { - for j in chunk_pos.y - 3..chunk_pos.y + 4 { + for i in chunk_pos.x - 4..chunk_pos.x + 5 { + for j in chunk_pos.y - 4..chunk_pos.y + 5 { for k in 0..2 { let key = Vec3::new(i, j, k); if self.state.terrain().get_key(key).is_none() && !self.pending_chunks.contains(&key) + && self.pending_chunks.len() < 4 { self.postbox .send_message(ClientMsg::TerrainChunkRequest { key }); diff --git a/server/src/lib.rs b/server/src/lib.rs index 830337bc60..4a70ffdbe4 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -202,7 +202,7 @@ impl Server { .map(|e: i32| e.abs()) .reduce_max(); - if dist < 5 { + if dist < 7 { self.clients.notify( entity, ServerMsg::TerrainChunkUpdate { @@ -234,7 +234,7 @@ impl Server { min_dist = min_dist.min(dist); } - if min_dist > 5 { + if min_dist > 7 { chunks_to_remove.push(key); } });