Mercurial > public > hwos_code
comparison src/p2_deco.c @ 591:146e50d2672f
BUGFIX: handle two deco gases configured to the same change depth
author | heinrichsweikamp |
---|---|
date | Thu, 15 Mar 2018 20:43:38 +0100 |
parents | e81cf407261a |
children | 1719de53e497 |
comparison
equal
deleted
inserted
replaced
590:b39a759a0e88 | 591:146e50d2672f |
---|---|
1154 // If yes, skip this gas as it is not to be used yet. | 1154 // If yes, skip this gas as it is not to be used yet. |
1155 // Remark: this check will also skip all disabled gases and the gas set | 1155 // Remark: this check will also skip all disabled gases and the gas set |
1156 // as 'first' because these have their change depth set to 0. | 1156 // as 'first' because these have their change depth set to 0. |
1157 if( sim_depth_limit > char_I_deco_gas_change[j] ) continue; | 1157 if( sim_depth_limit > char_I_deco_gas_change[j] ) continue; |
1158 | 1158 |
1159 // Is the change depth of the gas deeper than the change depth of the | 1159 // Is the change depth of the gas deeper or equal than the change depth of the |
1160 // gas we are currently one? | 1160 // gas we are currently one? |
1161 // If yes, skip this gas as it is not better than the current one. | 1161 // If yes, skip this gas as it is not better than the current one. |
1162 // Remark: if there is more than one gas with the same change depth, | 1162 // Remark: if there is more than one gas with the same change depth, |
1163 // the last one from the list will be taken. | 1163 // the last one from the list will be taken. |
1164 if( sim_gas_last_depth && (char_I_deco_gas_change[j] > sim_gas_last_depth) ) continue; | 1164 if( sim_gas_last_depth && (char_I_deco_gas_change[j] >= sim_gas_last_depth) ) continue; |
1165 | 1165 |
1166 // Is the change depth of the gas shallower or equal to the change depth | 1166 // Is the change depth of the gas shallower or equal to the change depth |
1167 // of the best gas found so far, or is it the first better gas found? | 1167 // of the best gas found so far, or is it the first better gas found? |
1168 // If yes, we have a better gas | 1168 // If yes, we have a better gas |
1169 if( char_I_deco_gas_change[j] < switch_depth ) | 1169 if( char_I_deco_gas_change[j] < switch_depth ) |