Temporary networking issue fix

Former-commit-id: e6b47f7d8478c28d837e55b85f2f2d028e988737
This commit is contained in:
Joshua Barretto 2019-05-09 19:38:37 +01:00
parent 54cc9e137a
commit faf53ad5c9
2 changed files with 5 additions and 4 deletions

View File

@ -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 });

View File

@ -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);
}
});