diff --git a/src/modules/butterflies/butterflies_generations.c b/src/modules/butterflies/butterflies_generations.c index 8252f0ca915acfd2d4428b190ba3de4a552abba8..54a6b5d43210bc74d32b91a655f12af7d2925757 100644 --- a/src/modules/butterflies/butterflies_generations.c +++ b/src/modules/butterflies/butterflies_generations.c @@ -21,18 +21,28 @@ void bf_area_generation_update(struct cats_grid *grid, struct cats_thread_info * const cats_dt_coord start_col = ts->area.start_col; const cats_dt_coord end_col = ts->area.end_col; - cats_dt_rates ot = grid->param.OT; - bool hybrid = grid->param.parametrization == PARAM_HYBRID; + const cats_dt_rates ot = grid->param.OT; for (cats_dt_coord row = start_row; row < end_row; row++) { for (cats_dt_coord col = start_col; col < end_col; col++) { - bool suitability_to_low = false; - if (hybrid && get_suitability(grid, row, col) < ot) suitability_to_low = true; - if (cell_excluded_by_overlay(conf, row, col) - || ! (data->info_layer[row][col] & BF_CELL_VALID_DISPERSAL_TARGET) - || suitability_to_low == true) { + if (get_suitability(grid, row, col) < ot) + { + data->eggs[row][col] = 0.0f; + data->generations[row][col] = 0.0f; + set_population_ignore_cc(grid, row, col, 0); + continue; + } + + if (cell_excluded_by_overlay(conf, row, col)) { + data->eggs[row][col] = 0.0f; + data->generations[row][col] = 0.0f; + set_population_ignore_cc(grid, row, col, 0); + continue; + } + + if ( ! (data->info_layer[row][col] & BF_CELL_VALID_DISPERSAL_TARGET)){ data->eggs[row][col] = 0.0f; data->generations[row][col] = 0.0f; set_population_ignore_cc(grid, row, col, 0);