Skip to content

Commit

Permalink
Fix obstacle placement to respect EmptyReserved
Browse files Browse the repository at this point in the history
  • Loading branch information
iMilchshake committed Jun 2, 2024
1 parent 49f045d commit 7a8775d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/post_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ pub fn fix_edge_bugs(gen: &mut Generator) -> Result<Array2<bool>, &'static str>
/// Using a distance transform this function will fill up all empty blocks that are too far
/// from the next solid/non-empty block
pub fn fill_open_areas(gen: &mut Generator, max_distance: &f32) -> Array2<f32> {
let grid = gen.map.grid.map(|val| *val != BlockType::Empty);
let grid = gen
.map
.grid
.map(|val| *val != BlockType::Empty && *val != BlockType::EmptyReserved);

// euclidean distance transform
let distance = dt_bool::<f32>(&grid.into_dyn())
Expand Down

0 comments on commit 7a8775d

Please sign in to comment.