not loading already loaded chunks

This commit is contained in:
Piotrek
2021-05-17 15:12:15 +02:00
parent 5266b32823
commit 65bacd745e
+4
View File
@@ -57,9 +57,13 @@ impl World {
* Sends chunk position to the ChunkLoader
*/
pub fn load_chunk(&mut self, pos: Vector3<i32>) {
if let Some(chunk) = self.chunks.get_mut(&pos) {
chunk.dirty = true;
} else {
self.loader.load(pos);
self.busy += 1;
}
}
/*
* Loads metadata