mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Validate O2 in best mix
We can't have >100% O2 Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
274ff270d8
commit
ae9e147314
1 changed files with 3 additions and 0 deletions
|
@ -3653,6 +3653,9 @@ fraction_t best_o2(depth_t depth, struct dive *dive)
|
|||
fraction_t fo2;
|
||||
|
||||
fo2.permille = (prefs.bottompo2 * 100 / depth_to_mbar(depth.mm, dive)) * 10; //use integer arithmetic to round down to nearest percent
|
||||
// Don't permit >100% O2
|
||||
if (fo2.permille > 1000)
|
||||
fo2.permille = 1000;
|
||||
return fo2;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue