Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
suprohub committed Jan 6, 2025
1 parent 38d7ed1 commit 1be6f32
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pumpkin-world/src/chunk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,12 @@ impl Subchunks {
match self {
Self::Single(block) => {
if *block != new_block {
*self = Self::Multi(
vec![Subchunk::Single(0); SUBCHUNKS_COUNT]
.try_into()
.unwrap(),
)
let mut subchunks = vec![Subchunk::Single(0); SUBCHUNKS_COUNT];

subchunks[(position.y.get_absolute() / 16) as usize]
.set_block(position, new_block);

*self = Self::Multi(subchunks.try_into().unwrap());
}
}
Self::Multi(subchunks) => {
Expand Down

0 comments on commit 1be6f32

Please sign in to comment.