mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add explicit setpoint change at t=0 when planning CCR dives
As we now have the logic that there is always an explicit setpoint at t=0sec for CCR dives, also the planner should honor that. This fixes a bug that when planning a CCR dive we later add a setpoint change this influenced the ceiling _before_ the setpoint change. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
182fe790c9
commit
c67812acc3
1 changed files with 4 additions and 5 deletions
|
@ -307,11 +307,10 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas)
|
|||
|
||||
/* Check for SetPoint change */
|
||||
if (oldpo2 != po2) {
|
||||
if (lasttime)
|
||||
/* this is a bad idea - we should get a different SAMPLE_EVENT type
|
||||
* reserved for this in libdivecomputer... overloading SMAPLE_EVENT_PO2
|
||||
* with a different meaning will only cause confusion elsewhere in the code */
|
||||
add_event(dc, lasttime, SAMPLE_EVENT_PO2, 0, po2, "SP change");
|
||||
/* this is a bad idea - we should get a different SAMPLE_EVENT type
|
||||
* reserved for this in libdivecomputer... overloading SMAPLE_EVENT_PO2
|
||||
* with a different meaning will only cause confusion elsewhere in the code */
|
||||
add_event(dc, lasttime, SAMPLE_EVENT_PO2, 0, po2, "SP change");
|
||||
oldpo2 = po2;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue