andriyDev / landmass

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

Fix Archipelago not being Sync. #35

Closed andriyDev closed 3 weeks ago

andriyDev commented 3 weeks ago

DisjointSet is not Sync due to holding Cells, so we have to workaround this by using a Mutex. This should be fine since we only lock the mutex whenever we do pathfinding and only for a short time to figure out whether the regions are connected.

If in the future we find the mutex being slow, we can even move the locking of the mutex outside of the pathfinding call to only lock once per frame (excluding updating the set).

codecov-commenter commented 3 weeks ago

Codecov Report

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

Project coverage is 98.3%. Comparing base (d198ce5) to head (606f0d9).

Additional details and impacted files | [Files](https://app.codecov.io/gh/andriyDev/landmass/pull/35?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [src/nav\_data.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/35?src=pr&el=tree&filepath=src%2Fnav_data.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL25hdl9kYXRhLnJz) | `99.3% <100.0%> (+<0.1%)` | :arrow_up: |