summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-03-08 20:28:45 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-03-08 12:54:39 -0700
commitc67812acc32fdaceeae80296edb7239b9e575406 (patch)
tree4d112992dc7cbd0e3ee13837023743bfd9bea194 /planner.c
parent182fe790c9e88898ec3d8bd4be68614a560415bb (diff)
downloadsubsurface-c67812acc32fdaceeae80296edb7239b9e575406.tar.gz
Add explicit setpoint change at t=0 when planning CCR dives
As we now have the logic that there is always an explicit setpoint at t=0sec for CCR dives, also the planner should honor that. This fixes a bug that when planning a CCR dive we later add a setpoint change this influenced the ceiling _before_ the setpoint change. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/planner.c b/planner.c
index d12f660f5..b6f0c4c5e 100644
--- a/planner.c
+++ b/planner.c
@@ -307,11 +307,10 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas)
/* Check for SetPoint change */
if (oldpo2 != po2) {
- if (lasttime)
- /* this is a bad idea - we should get a different SAMPLE_EVENT type
- * reserved for this in libdivecomputer... overloading SMAPLE_EVENT_PO2
- * with a different meaning will only cause confusion elsewhere in the code */
- add_event(dc, lasttime, SAMPLE_EVENT_PO2, 0, po2, "SP change");
+ /* this is a bad idea - we should get a different SAMPLE_EVENT type
+ * reserved for this in libdivecomputer... overloading SMAPLE_EVENT_PO2
+ * with a different meaning will only cause confusion elsewhere in the code */
+ add_event(dc, lasttime, SAMPLE_EVENT_PO2, 0, po2, "SP change");
oldpo2 = po2;
}