Correcly look at all relevant dive computer structures

When calculating maxima for a dive, we need to take data from all existing
dive computer structures plus potentially also a fake dive computer
structure that is just passed in in order to create a meaningful profile.

Commit 86c961614b ("Actually walk all dive computers, don't just claim
to do so") missed that second case and no longer took the fake_dc into
account, breaking the display of dives that don't have samples.

Reported-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-01-24 07:05:32 +12:00
parent 6aee901f6f
commit c3614424f9
3 changed files with 12 additions and 4 deletions

View file

@ -535,7 +535,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
* so I'll *not* calculate everything if something is not being
* shown.
*/
plotInfo = calculate_max_limits_new(&displayed_dive);
plotInfo = calculate_max_limits_new(&displayed_dive, currentdc);
create_plot_info_new(&displayed_dive, currentdc, &plotInfo, !shouldCalculateMaxDepth);
if (shouldCalculateMaxTime)
maxtime = get_maxtime(&plotInfo);