X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=dive.c;h=deb72fc804225712edf164d52ab1a4fca5ba1d93;hb=dbdd42b31f73ad8e8117d5b2a5b4ac4e061bf202;hp=d934d14384f8010a8a9ee22801d06e4f86798a82;hpb=2a8f7ab78f8d00b699b683b122ad2cf0ddc094b6;p=ext%2Fsubsurface.git diff --git a/dive.c b/dive.c index d934d14..deb72fc 100644 --- a/dive.c +++ b/dive.c @@ -154,8 +154,12 @@ static void fixup_pressure(struct dive *dive, struct sample *sample) cyl = dive->cylinder + index; if (!cyl->start.mbar) cyl->start.mbar = pressure; - if (!cyl->end.mbar || pressure < cyl->end.mbar) - cyl->end.mbar = pressure; + /* we need to handle the user entering beginning and end tank pressures + * - maybe even IF we have samples. But for now if we have air pressure + * data in the samples, we use that instead of the minimum + * if (!cyl->end.mbar || pressure < cyl->end.mbar) + */ + cyl->end.mbar = pressure; } struct dive *fixup_dive(struct dive *dive) @@ -406,7 +410,7 @@ struct dive *try_to_merge(struct dive *a, struct dive *b) int i; struct dive *res; - if (a->when != b->when) + if ((a->when >= b->when + 60) || (a->when <= b->when - 60)) return NULL; res = alloc_dive();