Fix bug in creating dive plan from dive

We don't want to add the last sample - the dive plan functions want to
figure out the path to the surface by themselves and get confused by this.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-12-03 20:52:28 -08:00
parent 9190c97a3c
commit 623be2e46f

View file

@ -438,7 +438,7 @@ void DivePlannerPointsModel::loadFromDive(dive* d)
// we start with the first gas and see if it was changed
int o2 = backupDive.cylinder[0].gasmix.o2.permille;
int he = backupDive.cylinder[0].gasmix.he.permille;
for (int i = 0; i < backupDive.dc.samples; i++) {
for (int i = 0; i < backupDive.dc.samples - 1; i++) {
const sample &s = backupDive.dc.sample[i];
if (s.time.seconds == 0)
continue;