mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Be more precise about the safety-stop.
There is no point in doing a stop at 5m if the last manual waypoint is shallower. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
95c2c06be4
commit
9ca033c550
1 changed files with 2 additions and 2 deletions
|
@ -807,7 +807,7 @@ void track_ascent_gas(int depth, cylinder_t *cylinder, int avg_depth, int bottom
|
||||||
if (deltad > depth)
|
if (deltad > depth)
|
||||||
deltad = depth;
|
deltad = depth;
|
||||||
update_cylinder_pressure(&displayed_dive, depth, depth - deltad, TIMESTEP, prefs.decosac, cylinder, true);
|
update_cylinder_pressure(&displayed_dive, depth, depth - deltad, TIMESTEP, prefs.decosac, cylinder, true);
|
||||||
if (depth <= 5000 && safety_stop){
|
if (depth <= 5000 && depth >= (5000 - deltad) && safety_stop) {
|
||||||
update_cylinder_pressure(&displayed_dive, 5000, 5000, 180, prefs.decosac, cylinder, true);
|
update_cylinder_pressure(&displayed_dive, 5000, 5000, 180, prefs.decosac, cylinder, true);
|
||||||
safety_stop = false;
|
safety_stop = false;
|
||||||
}
|
}
|
||||||
|
@ -978,7 +978,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
|
||||||
TIMESTEP, po2, &displayed_dive, prefs.decosac);
|
TIMESTEP, po2, &displayed_dive, prefs.decosac);
|
||||||
clock += TIMESTEP;
|
clock += TIMESTEP;
|
||||||
depth -= deltad;
|
depth -= deltad;
|
||||||
if (depth <= 5000 && safety_stop) {
|
if (depth <= 5000 && depth >= (5000 - deltad) && safety_stop) {
|
||||||
plan_add_segment(diveplan, clock - previous_point_time, 5000, gas, po2, false);
|
plan_add_segment(diveplan, clock - previous_point_time, 5000, gas, po2, false);
|
||||||
previous_point_time = clock;
|
previous_point_time = clock;
|
||||||
clock += 180;
|
clock += 180;
|
||||||
|
|
Loading…
Add table
Reference in a new issue