diff src/p2_deco.c @ 351:de8c45fb2ab9

BUGFIX gas volume: do not forget deco gas with switch >= dive's bottom depth.
author jdg@air
date Fri, 24 Jul 2015 14:52:39 +0200
parents fca4f9de5f4a
children 6ec79c5384f5
line wrap: on
line diff
--- a/src/p2_deco.c	Thu Jul 23 12:53:35 2015 +0200
+++ b/src/p2_deco.c	Fri Jul 24 14:52:39 2015 +0200
@@ -1187,7 +1187,7 @@
                     calc_ascenttime();
                     char_O_deco_status = 0;         // calc nullzeit next time.
                     char_O_deco_last_stop = 0;      // Surface reached (to animate menu)
-                        return;
+                    return;
                 }
             }
         //---- Then update tissue --------------------------------------------
@@ -2194,7 +2194,8 @@
             * bottom_usage;                             // In liter/minutes.
 
     //---- Ascent usage ------------------------------------------------------
-    depth = lastGasStop = char_I_bottom_depth;
+    depth = char_I_bottom_depth;
+    lastGasStop = 255;          // Allow deco gas at or below bottom depth
 
     for(i=0; i<NUM_STOPS; ++i)
     {
@@ -2210,7 +2211,7 @@
         for(;;)
         {
             overlay unsigned char newGas  = 0;
-            overlay unsigned char newStop = 0;  // NO CHANGE yet
+            overlay unsigned char newStop = 0;  // Mark as NO CHANGE yet
             overlay unsigned char j;
 
             for(j=0; j<NUM_GAS; ++j)