Look around DCs dive time for automatically fixed positions.

dive = find_dive_including(gpsfix->when);

only finds dives which have a fix during the underwater time.  If the positions have
been fixed before or after the dive, fails quietly.  So let's test this situation and, in case,
pass the job to  find_dive_n_near().

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Salvador Cuñat 2014-06-23 22:06:03 +02:00 committed by Dirk Hohndel
parent 0deee63b5e
commit 2ae6f8078a

View file

@ -50,8 +50,7 @@ static bool merge_locations_into_dives(void)
sort_table(&gps_location_table);
for_each_gps_location (i, gpsfix) {
if (is_automatic_fix(gpsfix)) {
dive = find_dive_including(gpsfix->when);
if (is_automatic_fix(gpsfix) && (dive = find_dive_including(gpsfix->when))) {
if (dive && !dive_has_gps_location(dive)) {
#if DEBUG_WEBSERVICE
struct tm tm;