aboutsummaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/dive.c b/core/dive.c
index 6406242bf..8270c5478 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -648,6 +648,13 @@ struct sample *prepare_sample(struct divecomputer *dc)
}
sample = dc->sample + nr;
memset(sample, 0, sizeof(*sample));
+
+ // Copy the sensor numbers - but not the pressure values
+ // from the previous sample if any.
+ if (nr) {
+ sample->sensor[0] = sample[-1].sensor[0];
+ sample->sensor[1] = sample[-1].sensor[1];
+ }
return sample;
}
return NULL;