From 30746e5d3f6b20a0603359f55f232fb082362f39 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Tue, 26 Mar 2019 10:35:41 +0100 Subject: Make sure surface air is not considered a deco gas it creapt in through the gaschange events. Signed-off-by: Robert C. Helling --- core/planner.c | 1 + qt-models/cylindermodel.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/core/planner.c b/core/planner.c index ff483a0ac..ce3ef30f2 100644 --- a/core/planner.c +++ b/core/planner.c @@ -1085,6 +1085,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i // Switch to an empty air cylinder for breathing air at the surface // If no empty cylinder is found, keep using last deco gas current_cylinder = i; + dive->cylinder[i].cylinder_use = NOT_USED; break; } plan_add_segment(diveplan, prefs.surface_segment, 0, current_cylinder, 0, false, OC); diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp index 11d4595ee..129f25a6c 100644 --- a/qt-models/cylindermodel.cpp +++ b/qt-models/cylindermodel.cpp @@ -442,6 +442,7 @@ void CylindersModel::add() fill_default_cylinder(&displayed_dive.cylinder[row]); displayed_dive.cylinder[row].start = displayed_dive.cylinder[row].type.workingpressure; displayed_dive.cylinder[row].manually_added = true; + displayed_dive.cylinder[row].cylinder_use = OC_GAS; beginInsertRows(QModelIndex(), row, row); rows++; changed = true; -- cgit v1.2.3-70-g09d2