summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-01-08 14:42:07 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-10 17:27:24 -0800
commit0f7f2195d56effff234430cc4314c5216d518a8d (patch)
tree423c07dd727b7dc06f973b698e7a395a3ae44b3c /dive.c
parenta478eb5711db6a1950cf810ca0b67414b6910030 (diff)
downloadsubsurface-0f7f2195d56effff234430cc4314c5216d518a8d.tar.gz
Add setpoint events according to divetype
When changing to a CCR dive, add a setpoint change to the default setpoint at the beginning of the dive. Otherwise add an explicit setpoint change to 0 . Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/dive.c b/dive.c
index 680ceeb58..c464e7e33 100644
--- a/dive.c
+++ b/dive.c
@@ -888,8 +888,10 @@ void update_setpoint_events(struct divecomputer *dc)
}
ev = get_next_event(ev->next, "SP change");
}
- if (!changed)
- add_event(dc, 0, SAMPLE_EVENT_PO2, 0, new_setpoint, "SP change");
+ if (!changed) {
+ if (!add_event(dc, 0, SAMPLE_EVENT_PO2, 0, new_setpoint, "SP change"))
+ printf("Could not add setpoint change event\n");
+ }
}
void sanitize_gasmix(struct gasmix *mix)