From dba27eda05cfc6d2836c921b60c88caf37265d4e Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <helling@atdotde.de>
Date: Mon, 3 Nov 2014 22:37:59 +0100
Subject: [PATCH] Start with 0 when computing maxdepth when fixing up

This is needed to get the correct maxdepth when replanning
leads to a shallower dive.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
---
 qt-ui/diveplanner.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index d490de3..4a299ca 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -1185,6 +1185,8 @@ void DivePlannerPointsModel::createPlan()
 	} else if (current_dive && displayed_dive.id == current_dive->id) {
 		// we are replanning a dive - make sure changes are reflected
 		// correctly in the dive structure and copy it back into the dive table
+		displayed_dive.maxdepth.mm = 0;
+		displayed_dive.dc.maxdepth.mm = 0;
 		fixup_dive(&displayed_dive);
 		copy_dive(&displayed_dive, current_dive);
 	}
-- 
1.9.3 (Apple Git-50)

