comparison src/p2_deco.c @ 597:66334c6adcf6

BUGFIX: "lost gas" was re-activated in rare cases
author heinrichsweikamp
date Sun, 08 Jul 2018 12:22:20 +0200
parents 1719de53e497
children ab88a7e3de94
comparison
equal deleted inserted replaced
596:2b4e02a9c1e4 597:66334c6adcf6
2696 2696
2697 for(x=0; x<NUM_STOPS; ++x) 2697 for(x=0; x<NUM_STOPS; ++x)
2698 { 2698 {
2699 internal_deco_time [x] = 0; 2699 internal_deco_time [x] = 0;
2700 internal_deco_depth[x] = 0; 2700 internal_deco_depth[x] = 0;
2701 internal_deco_gas[x] = 0;
2701 } 2702 }
2702 2703
2703 // clear stop table overflow warning 2704 // clear stop table overflow warning
2704 char_O_deco_warnings &= ~DECO_WARNING_STOPTABLE_OVERFLOW; 2705 char_O_deco_warnings &= ~DECO_WARNING_STOPTABLE_OVERFLOW;
2705 } 2706 }
3538 // convert depth of the stop 3539 // convert depth of the stop
3539 float_depth = (float)stop_depth; 3540 float_depth = (float)stop_depth;
3540 3541
3541 // get the next gas 3542 // get the next gas
3542 stop_gas = internal_deco_gas[i]; 3543 stop_gas = internal_deco_gas[i];
3543 3544
3545 // in case of end-of-table, keep the last gas
3546 if( !stop_gas ) stop_gas = stop_gas_last;
3547
3544 // do we we have a gas change? 3548 // do we we have a gas change?
3545 if( stop_gas_last && (stop_gas != stop_gas_last) ) 3549 if( stop_gas_last && (stop_gas != stop_gas_last) )
3546 { 3550 {
3547 // yes - spend an additional char_I_gas_change_time on the old gas 3551 // yes - spend an additional char_I_gas_change_time on the old gas
3548 float_time = (float)char_I_gas_change_time; 3552 float_time = (float)char_I_gas_change_time;