andriyDev / landmass

A navigation system for video games written in Rust.
Apache License 2.0
30 stars 2 forks source link

Fix a crash when creating nav meshes with no polygons or vertices. #52

Closed andriyDev closed 3 months ago

andriyDev commented 3 months ago

Previously no polygons or vertices would just crash. Now these nav meshes are ignored. We could call empty nav meshes invalid (and check for this in NavigationMesh::validate). I am still on the fence about that, so for now we are just gonna fix it and move on.

Also bumped the dodgy version.

codecov-commenter commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.0%. Comparing base (77f0894) to head (b86587c).

Additional details and impacted files | [Files](https://app.codecov.io/gh/andriyDev/landmass/pull/52?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [crates/landmass/src/nav\_data.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/52?src=pr&el=tree&filepath=crates%2Flandmass%2Fsrc%2Fnav_data.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y3JhdGVzL2xhbmRtYXNzL3NyYy9uYXZfZGF0YS5ycw==) | `99.4% <100.0%> (+<0.1%)` | :arrow_up: | | [crates/landmass/src/nav\_data\_test.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/52?src=pr&el=tree&filepath=crates%2Flandmass%2Fsrc%2Fnav_data_test.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y3JhdGVzL2xhbmRtYXNzL3NyYy9uYXZfZGF0YV90ZXN0LnJz) | `99.5% <100.0%> (+<0.1%)` | :arrow_up: | | [crates/landmass/src/util.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/52?src=pr&el=tree&filepath=crates%2Flandmass%2Fsrc%2Futil.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y3JhdGVzL2xhbmRtYXNzL3NyYy91dGlsLnJz) | `94.9% <100.0%> (+<0.1%)` | :arrow_up: |