This commit is contained in:
parent
5d7101ae0b
commit
c8e02c6f86
1 changed files with 7 additions and 4 deletions
|
@ -123,15 +123,19 @@ impl Renderable for World {
|
||||||
if let Some(chunk) = self.chunks.get(&position) {
|
if let Some(chunk) = self.chunks.get(&position) {
|
||||||
if let Err(err) = chunk.save(position, &self.chunk_database) {
|
if let Err(err) = chunk.save(position, &self.chunk_database) {
|
||||||
eprintln!("Failed to save chunk {:?}: {:?}", position, err);
|
eprintln!("Failed to save chunk {:?}: {:?}", position, err);
|
||||||
} else if unload {
|
} else {
|
||||||
|
if unload {
|
||||||
self.chunks.remove(&position);
|
self.chunks.remove(&position);
|
||||||
|
|
||||||
if DEBUG_IO {
|
if DEBUG_IO {
|
||||||
println!("Saved and unloaded chunk {:?}", position);
|
println!("Saved and unloaded chunk {:?}", position);
|
||||||
}
|
}
|
||||||
} else if DEBUG_IO {
|
} else {
|
||||||
|
if DEBUG_IO {
|
||||||
println!("Saved chunk {:?}", position);
|
println!("Saved chunk {:?}", position);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
eprintln!("Tried to save unloaded chunk {:?}", position);
|
eprintln!("Tried to save unloaded chunk {:?}", position);
|
||||||
}
|
}
|
||||||
|
@ -292,8 +296,7 @@ impl World {
|
||||||
chunk.blocks[by][bz][bx] = block;
|
chunk.blocks[by][bz][bx] = block;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.chunk_save_queue
|
self.enqueue_chunk_save(chunk_position, false);
|
||||||
.push_back((chunk_position / CHUNK_ISIZE, false));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn calc_scale(vector: Vector3<f32>, scalar: f32) -> f32 {
|
fn calc_scale(vector: Vector3<f32>, scalar: f32) -> f32 {
|
||||||
|
|
Loading…
Reference in a new issue