summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/planner.c b/planner.c
index 512034a2e..41cc0baa1 100644
--- a/planner.c
+++ b/planner.c
@@ -78,8 +78,9 @@ void get_gas_from_events(struct divecomputer *dc, int time, int *o2, int *he)
struct event *event = dc->events;
while (event && event->time.seconds <= time) {
if (!strcmp(event->name, "gaschange")) {
- *o2 = 10 * event->value & 0xffff;
- *he = 10 * event->value >> 16;
+ struct gasmix *g = get_gasmix_from_event(event);
+ *o2 = get_o2(g);
+ *he = get_he(g);
}
event = event->next;
}