From 15b6953438fd45921fe7adc16995eb89d25339a9 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Mon, 5 Mar 2018 21:19:42 +0100 Subject: Use the current dive mode instead of constant In the if case above, we already conclude its a OC dive, but its cleaner to actually pass the current mode instead of a hard coded value. This also makes the code less prune to future bugs. Signed-off-by: Anton Lundin --- core/dive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/dive.c') diff --git a/core/dive.c b/core/dive.c index 9ba180c6f..900677eb4 100644 --- a/core/dive.c +++ b/core/dive.c @@ -1030,7 +1030,7 @@ void update_setpoint_events(struct dive *dive, struct divecomputer *dc) gasmix = get_gasmix_from_event(dive, ev); next = get_next_event(ev, "gaschange"); } - fill_pressures(&pressures, calculate_depth_to_mbar(dc->sample[i].depth.mm, dc->surface_pressure, 0), gasmix ,0, OC); + fill_pressures(&pressures, calculate_depth_to_mbar(dc->sample[i].depth.mm, dc->surface_pressure, 0), gasmix ,0, dc->divemode); if (abs(dc->sample[i].setpoint.mbar - (int)(1000 * pressures.o2)) <= 50) dc->sample[i].setpoint.mbar = 0; } -- cgit v1.2.3-70-g09d2