not loading already loaded chunks
This commit is contained in:
@@ -57,9 +57,13 @@ impl World {
|
|||||||
* Sends chunk position to the ChunkLoader
|
* Sends chunk position to the ChunkLoader
|
||||||
*/
|
*/
|
||||||
pub fn load_chunk(&mut self, pos: Vector3<i32>) {
|
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.loader.load(pos);
|
||||||
self.busy += 1;
|
self.busy += 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Loads metadata
|
* Loads metadata
|
||||||
|
|||||||
Reference in New Issue
Block a user