diff options
Diffstat (limited to 'planner.c')
-rw-r--r-- | planner.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -257,14 +257,14 @@ static void create_dive_from_plan(struct diveplan *diveplan) printf("in create_dive_from_plan\n"); dump_plan(diveplan); #endif - // clear out the dive, fill in the basics and get started - clear_dive(&displayed_dive); - displayed_dive.when = diveplan->when; - displayed_dive.dc.surface_pressure.mbar = diveplan->surface_pressure; + // reset the cylinders and clear out the samples of the displayed dive so we can restart + reset_cylinders(&displayed_dive); dc = &displayed_dive.dc; - dc->model = "planned dive"; /* do not translate here ! */ + free(dc->sample); + dc->sample = NULL; + dc->samples = 0; + dc->alloc_samples = 0; dp = diveplan->dp; - reset_cylinders(&displayed_dive); cyl = &displayed_dive.cylinder[0]; oldgasmix = cyl->gasmix; sample = prepare_sample(dc); |