summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Willem Ferguson <willemferguson@zoology.up.ac.za>2018-04-09 21:37:03 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-05-14 23:47:00 +0300
commit5bac32a1b57862579d15e70ce1c5f1e8adab59b8 (patch)
tree8ddf3d8afdeb8c0d8aba80ae870e4dd9b08bbe72 /core
parent4c73ada121f6c847c024d417e3273254c5a7d1d3 (diff)
downloadsubsurface-5bac32a1b57862579d15e70ce1c5f1e8adab59b8.tar.gz
Fix a bug where the bailout events are not saved correctly.
The bailout events in the planner are not saved correctly. My oversight. This commits corrects the bug Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Diffstat (limited to 'core')
-rw-r--r--core/planner.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/planner.c b/core/planner.c
index 993883f8d..51b3a487b 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -342,7 +342,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, struct dive *dive,
}
if (dp->divemode != type) {
type = dp->divemode;
- add_event(dc, lasttime, 50 + type, 0, 0, divemode_text[type]);
+ add_event(dc, lasttime, 8, 0, type, "modechange");
}
/* Create sample */
@@ -736,7 +736,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i
current_cylinder = get_cylinderid_at_time(dive, &dive->dc, sample->time);
// FIXME: This needs a function to find the divemode at the end of the dive like in
- // divemode = get_divemode_at_time(dive, &dive->dc, sample->time);
+ // divemode = get_current_divemode(&dive->dc, 1e5, &ev, &divemode);
gas = dive->cylinder[current_cylinder].gasmix;
po2 = sample->setpoint.mbar;
@@ -786,7 +786,6 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i
diveplan->surface_interval = tissue_at_end(ds, dive, cached_datap);
nuclear_regeneration(ds, clock);
vpmb_start_gradient(ds);
-
if (decoMode() == RECREATIONAL) {
bool safety_stop = prefs.safetystop && max_depth >= 10000;
track_ascent_gas(depth, &dive->cylinder[current_cylinder], avg_depth, bottom_time, safety_stop);
@@ -1014,7 +1013,8 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i
pendinggaschange = false;
}
- int new_clock = wait_until(ds, dive, clock, clock, laststoptime * 2 + 1, timestep, depth, stoplevels[stopidx], avg_depth, bottom_time, &dive->cylinder[current_cylinder].gasmix, po2, diveplan->surface_pressure / 1000.0, divemode);
+ int new_clock = wait_until(ds, dive, clock, clock, laststoptime * 2 + 1, timestep, depth, stoplevels[stopidx], avg_depth,
+ bottom_time, &dive->cylinder[current_cylinder].gasmix, po2, diveplan->surface_pressure / 1000.0, divemode);
laststoptime = new_clock - clock;
/* Finish infinite deco */
if (laststoptime >= 48 * 3600 && depth >= 6000) {