aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-11 16:52:02 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-11 09:31:36 -0800
commit1a0f6f53ede1a945c9964fc9de73780a94cd8217 (patch)
treeacb1ecf31435dc335d187680161eb6acd008c1b4 /core
parentcd32c280ae063e143faebf9c5cf497e6dce3abb7 (diff)
downloadsubsurface-1a0f6f53ede1a945c9964fc9de73780a94cd8217.tar.gz
undo: set dive mode to CCR in undo command, not profile code
When setting a CCR setpoint, the profile code(!) would turn the dive into a CCR dive. Not only should the display layer not alter dives, this also means that the action is not undoable. Move that to the appropriate undo command, where it makes more sense, but obviously also makes things more complicated. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r--core/profile.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/core/profile.c b/core/profile.c
index e32a4bcd7..18c588b2a 100644
--- a/core/profile.c
+++ b/core/profile.c
@@ -345,8 +345,6 @@ static void check_setpoint_events(const struct dive *dive, struct divecomputer *
do {
i = set_setpoint(pi, i, setpoint.mbar, ev->time.seconds);
setpoint.mbar = ev->value;
- if (setpoint.mbar)
- dc->divemode = CCR;
ev = get_next_event(ev->next, "SP change");
} while (ev);
set_setpoint(pi, i, setpoint.mbar, INT_MAX);