diff options
author | Robert C. Helling <helling@atdotde.de> | 2014-06-03 20:08:38 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-03 11:39:49 -0700 |
commit | 5a62eeffead944ba6e9b5de50b428c3c123fe3f7 (patch) | |
tree | 7548ecf2cee96781e633b5a50ca5cb0eed73b05c /planner.c | |
parent | 1f1dcecc02a5c33c81d41a8a7c6aa2b9cc6b6da5 (diff) | |
download | subsurface-5a62eeffead944ba6e9b5de50b428c3c123fe3f7.tar.gz |
Planner: Show gas changes at the correct depth.
Gas changes (can) have a bogus waypoint following at the same depth with 0
time. Those were confusing the decision whether to show a waypoint.
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -569,7 +569,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool gaschange = true; if (plan_verbatim) { if (dp->depth != lastdepth) { - if (plan_display_transitions || dp->entered || !dp->next || (gaschange && dp->next && dp->depth != dp->next->depth)) + if (plan_display_transitions || dp->entered || !dp->next || (gaschange && dp->next && (dp->depth != dp->next->depth || !dp->next->time))) len += snprintf(buffer + len, sizeof(buffer) - len, translate("gettextFromC", "Transition to %.*f %s in %d:%02d min - runtime %d:%02u on %s<br>"), decimals, depthvalue, depth_unit, FRACTION(dp->time - lasttime, 60), @@ -583,7 +583,7 @@ static void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool gasname(&gasmix)); } } else { - if (dp->depth == lastdepth || plan_display_transitions || dp->entered || !dp->next || (gaschange && dp->next && dp->depth != dp->next->depth)) { + if (dp->depth == lastdepth || plan_display_transitions || dp->entered || !dp->next || (gaschange && dp->next && (dp->depth != dp->next->depth || !dp->next->time))) { len += snprintf(buffer + len, sizeof(buffer) - len, translate("gettextFromC", "<tr><td align=right>%3.0f%s</td>"), depthvalue, depth_unit); if (plan_display_runtime) len += snprintf(buffer + len, sizeof(buffer) - len, translate("gettextFromC", " <td align=right>%3dmin</td> "), (dp->time + 30) / 60); |