Skip to content

Commit

Permalink
saving issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
suprohub committed Jan 10, 2025
1 parent c63b84c commit 95b5683
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pumpkin-world/src/level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,15 @@ impl Level {
}

pub async fn write_chunk(&self, chunk_to_write: (Vector2<i32>, Arc<RwLock<ChunkData>>)) {
let data = chunk_to_write.1.read().await;
if let Err(error) = self.chunk_writer.write_chunk(&data, &chunk_to_write.0) {
if let Err(error) = self.raw_chunk_writer.write_raw_chunk(
self.chunk_writer
.write_chunk(&*chunk_to_write.1.read().await, &chunk_to_write.0)
.unwrap(),
&self.level_folder,
&chunk_to_write.0,
) {
log::error!("Failed writing Chunk to disk {}", error.to_string());
}
};
}

fn load_chunk_from_save(
Expand Down

0 comments on commit 95b5683

Please sign in to comment.