[PATCH] Don't ignore actual diveable mixes
Anton Lundin
glance at acc.umu.se
Tue Jun 10 14:00:01 PDT 2014
Fist is really obvious. I quite regularly decompress using pure O2. Its
as good last decompression gas as you get.
The second is a bit harder. There are quite few that dive with 80%+
helium in there mixes but they exists, and there are real weirdos that
dive heliox, so they are actual diveable gases too.
Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
libdivecomputer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libdivecomputer.c b/libdivecomputer.c
index e8a0338..8add6fd 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -116,9 +116,9 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
he = rint(gasmix.helium * 1000);
/* Ignore bogus data - libdivecomputer does some crazy stuff */
- if (o2 + he <= O2_IN_AIR || o2 >= 1000)
+ if (o2 + he <= O2_IN_AIR || o2 > 1000)
o2 = 0;
- if (he < 0 || he >= 800 || o2 + he >= 1000)
+ if (he < 0 || o2 + he > 1000)
he = 0;
dive->cylinder[i].gasmix.o2.permille = o2;
--
1.9.1
More information about the subsurface
mailing list