From 623be2e46f8bd7aff83f0ab18328d10a0da6d100 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 3 Dec 2013 20:52:28 -0800 Subject: 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 --- qt-ui/diveplanner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qt-ui/diveplanner.cpp') 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; -- cgit v1.2.3-70-g09d2