bug fixes
This commit is contained in:
@@ -26,11 +26,11 @@ impl World {
|
||||
let ch_pos = block_pos / chunk::SIZE;
|
||||
let bl_pos = block_pos % chunk::SIZE;
|
||||
// Create chunk if does not exist
|
||||
if let None = self.chunks.get_mut(&ch_pos) {
|
||||
if let None = self.chunks.get(&ch_pos) {
|
||||
self.chunks.insert(block_pos.clone(), WorldChunk::new());
|
||||
}
|
||||
// Generate block for chunk
|
||||
let chunk = self.chunks.get_mut(block_pos).unwrap();
|
||||
let chunk = self.chunks.get_mut(&ch_pos).unwrap();
|
||||
let block = chunk.get_block(&bl_pos);
|
||||
WorldGen::generate(&bl_pos, block);
|
||||
block
|
||||
|
||||
Reference in New Issue
Block a user