From 94164bb8fab08be32ffa2d576ec4ff56d6530ce2 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Wed, 18 Oct 2023 07:30:31 +0200 Subject: [PATCH] Correctly update mino2 When we've already seen a trimix gas, of we after that see a nitrox gas with less o2, it shouldn't update the mino2 state. Signed-off-by: Anton Lundin --- core/divelist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/divelist.c b/core/divelist.c index be7f2831a..8886d7ce2 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -47,7 +47,7 @@ void get_dive_gas(const struct dive *dive, int *o2_p, int *he_p, int *o2max_p) continue; if (o2 > maxo2) maxo2 = o2; - if (o2 < mino2) + if (o2 < mino2 && maxhe <= 0) mino2 = o2; if (he > maxhe) goto newmax;