Correctly update brickgrid when brickmaps are empty

This commit is contained in:
Jarrod Doyle 2023-05-06 12:43:40 +01:00
parent 95dd469f7a
commit 3d8719275d
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 6 additions and 0 deletions

View File

@ -229,6 +229,12 @@ impl BrickmapManager {
+ chunk_y * world_dims[0]
+ chunk_z * world_dims[0] * world_dims[1]) as usize;
// Don't upload it if it's empty
if albedo_data.is_empty() {
self.update_brickgrid_element(context, chunk_idx, 0);
continue;
}
// Update the brickgrid index
let brickgrid_element = ((self.brickmap_cache_idx as u32) << 8) + 4;
self.update_brickgrid_element(context, chunk_idx, brickgrid_element);