mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
cylindermodel: remove in_planner() use
in_planner() is problematic, since it is uses desktop-only application state. Since the cylinder-model already has an appropriate inPlanner flag, use this instead. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
e47b812fd0
commit
b36178a00a
3 changed files with 7 additions and 7 deletions
|
@ -3118,10 +3118,10 @@ void split_divecomputer(const struct dive *src, int num, struct dive **out1, str
|
|||
}
|
||||
|
||||
//Calculate O2 in best mix
|
||||
fraction_t best_o2(depth_t depth, const struct dive *dive)
|
||||
fraction_t best_o2(depth_t depth, const struct dive *dive, bool in_planner)
|
||||
{
|
||||
fraction_t fo2;
|
||||
int po2 = in_planner() ? prefs.bottompo2 : prefs.modpO2 * 1000;
|
||||
int po2 = in_planner ? prefs.bottompo2 : prefs.modpO2 * 1000;
|
||||
|
||||
fo2.permille = (po2 * 100 / depth_to_mbar(depth.mm, dive)) * 10; //use integer arithmetic to round down to nearest percent
|
||||
// Don't permit >100% O2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue