Skip to content

Commit

Permalink
disallow heightfinder to go below water line
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriopass committed Jan 22, 2024
1 parent 77a5b49 commit 1046451
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions simulation/src/map/objects/road.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,13 @@ impl Road {
)
.chain(std::iter::once(p.last()))
{
let h = env.height(pos).unwrap_or_else(|| {
height_error = true;
0.0
});
let h = env
.height(pos)
.unwrap_or_else(|| {
height_error = true;
0.0
})
.max(0.0);
contour.push(h);
points.push(pos.z(h));
}
Expand Down

0 comments on commit 1046451

Please sign in to comment.