Skip to content

Commit

Permalink
remove ?
Browse files Browse the repository at this point in the history
  • Loading branch information
suprohub committed Jan 10, 2025
1 parent c7ceff8 commit c63b84c
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions pumpkin-world/src/level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,23 @@ impl Level {
save_file: &LevelFolder,
chunk_pos: Vector2<i32>,
) -> Result<Option<Arc<RwLock<ChunkData>>>, ChunkReadingError> {
match chunk_reader.read_chunk(
raw_chunk_reader
.read_raw_chunk(save_file, &chunk_pos)
.map_err(|_| ChunkReadingError::ChunkNotExist)?,
&chunk_pos,
) {
Ok(data) => Ok(Some(Arc::new(RwLock::new(data)))),
match raw_chunk_reader
.read_raw_chunk(save_file, &chunk_pos)
.map_err(|_| ChunkReadingError::ChunkNotExist)
{
Ok(chunk_bytes) => {
match chunk_reader.read_chunk(chunk_bytes, &chunk_pos) {
Ok(data) => Ok(Some(Arc::new(RwLock::new(data)))),
Err(
ChunkReadingError::ChunkNotExist
| ChunkReadingError::ParsingError(ChunkParsingError::ChunkNotGenerated),
) => {
// This chunk was not generated yet.
Ok(None)
}
Err(err) => Err(err),
}
}
Err(
ChunkReadingError::ChunkNotExist
| ChunkReadingError::ParsingError(ChunkParsingError::ChunkNotGenerated),
Expand Down

0 comments on commit c63b84c

Please sign in to comment.