# HG changeset patch
# User JeanDo
# Date 1299198018 -3600
# Node ID 24cd6e256d61e08cea7c028be6a77915c84c206d
# Parent  2dc4a7340510c70452bb4070539d4d2271036301
Better gas lookup policy, supporting unsorted list.

diff -r 2dc4a7340510 -r 24cd6e256d61 code_part1/OSTC_code_c_part2/p2_deco.c
--- a/code_part1/OSTC_code_c_part2/p2_deco.c	Thu Mar 03 15:52:16 2011 +0100
+++ b/code_part1/OSTC_code_c_part2/p2_deco.c	Fri Mar 04 01:20:18 2011 +0100
@@ -890,7 +890,7 @@
         // sim_gas_last_used: used to detect just once in each ascent simu.
         // N2_ratio         : used to detect when already breathing that gas.
         if( temp_depth_limit != switch_deco
-         && sim_gas_last_used < temp_gas_switch
+         && sim_gas_last_used != temp_gas_switch
          && sim_gas_delay <= sim_dive_mins )
         {
             sim_gas_last_used = temp_gas_switch;
@@ -943,7 +943,7 @@
         // Should restart gas-switch delay only when gas do changes...
         // sim_gas_last_used: used to detect just once in each ascent simu.
         // N2_ratio         : used to detect when already breathing that gas.
-        if( sim_gas_last_used < temp_gas_switch
+        if( sim_gas_last_used != temp_gas_switch
          && sim_gas_delay <= sim_dive_mins )
         {
             sim_gas_last_used = temp_gas_switch;
diff -r 2dc4a7340510 -r 24cd6e256d61 code_part1/OSTC_code_c_part2/p2_deco.o
Binary file code_part1/OSTC_code_c_part2/p2_deco.o has changed