mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:03:23 +00:00
Decrease gaschange index even if we are already breathing the new mix
This fixes a bug where we would not do any gas changes at all if at the end of bottom time we were deeper than the MOD of the bottom mix. Instead we would constantly try to switch to that gas and find we are already breathing it. A test case would be a dive with air and EAN50 to more than 66m. That would have never switched to EAN50. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
abbebef997
commit
e79cae577d
1 changed files with 2 additions and 1 deletions
|
@ -1142,6 +1142,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
|
|||
* We might not if the cylinder was chosen by the user
|
||||
* or user has selected only to switch only at required stops.
|
||||
* If current gas is hypoxic, we want to switch asap */
|
||||
|
||||
if (current_cylinder != gaschanges[gi].gasidx) {
|
||||
if (!prefs.switch_at_req_stop ||
|
||||
!trial_ascent(depth, stoplevels[stopidx - 1], avg_depth, bottom_time, tissue_tolerance,
|
||||
|
@ -1165,8 +1166,8 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
|
|||
*/
|
||||
pendinggaschange = true;
|
||||
}
|
||||
gi--;
|
||||
}
|
||||
gi--;
|
||||
}
|
||||
--stopidx;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue