aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-03 20:52:28 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-03 20:52:28 -0800
commit623be2e46f8bd7aff83f0ab18328d10a0da6d100 (patch)
treecaa0bc3649541c2f2878ad74c0eff454e4b43fbe /qt-ui/diveplanner.cpp
parent9190c97a3c2c9c73f0a351e7478077b057993955 (diff)
downloadsubsurface-623be2e46f8bd7aff83f0ab18328d10a0da6d100.tar.gz
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>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index a80ae68ae..4502814de 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -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;