diff code_part1/OSTC_code_c_part2/p2_deco.c @ 226:24cd6e256d61

Better gas lookup policy, supporting unsorted list.
author JeanDo
date Fri, 04 Mar 2011 01:20:18 +0100
parents 2dc4a7340510
children 2cbaa01dac26
line wrap: on
line diff
--- 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;