diff --git a/src/modules/butterflies/butterflies_overlays.c b/src/modules/butterflies/butterflies_overlays.c index 2f218bb10223548950e34f4be08809df2596066e..a52fc744452c847356cd7f2f839c7c019aab9e96 100644 --- a/src/modules/butterflies/butterflies_overlays.c +++ b/src/modules/butterflies/butterflies_overlays.c @@ -25,6 +25,8 @@ enum action_status bf_grid_overlay_update(const struct cats_configuration *conf, int64_t cells_excluded = 0; int64_t cells_resource_ok = 0; int64_t cells_habitat_and_resource_ok = 0; + int64_t cells_eggs_removed = 0; + int64_t cells_adults_removed = 0; for (cats_dt_coord row = 0; row < rows; row++) { for (cats_dt_coord col = 0; col < cols; col++) { @@ -33,6 +35,8 @@ enum action_status bf_grid_overlay_update(const struct cats_configuration *conf, if (cell_excluded_by_overlay(conf, row, col)) { data->info_layer[row][col] |= BF_CELL_EXCLUDED; + if (data->eggs[row][col]) cells_eggs_removed += 1; + if (get_adult_population(grid, row, col)) cells_adults_removed += 1; data->eggs[row][col] = 0; set_population_ignore_cc(grid, row, col, 0); cells_excluded += 1; @@ -58,6 +62,8 @@ enum action_status bf_grid_overlay_update(const struct cats_configuration *conf, cells_habitat_and_resource_ok += 1; } else { + if (data->eggs[row][col]) cells_eggs_removed += 1; + if (get_adult_population(grid, row, col)) cells_adults_removed += 1; data->eggs[row][col] = 0; set_population_ignore_cc(grid, row, col, 0); } @@ -79,6 +85,9 @@ enum action_status bf_grid_overlay_update(const struct cats_configuration *conf, log_message(LOG_INFO, "Overlay update: %ld excluded, %ld habitat ok, %ld resource ok, %ld habitat + resource ok", cells_excluded, cells_habitat_ok, cells_resource_ok, cells_habitat_and_resource_ok); - log_message(LOG_INFO, "Overlay update %ld cells with eggs, total %f eggs, average %f eggs per cell", cells_with_eggs, total_eggs, total_eggs/(float) cells_with_eggs); + log_message(LOG_INFO, "Overlay update: %ld cells with eggs, total %f eggs, average %f eggs per cell", cells_with_eggs, total_eggs, total_eggs/(float) cells_with_eggs); + log_message(LOG_INFO, "Overlay update: %ld cells with eggs removed", cells_eggs_removed ); + log_message(LOG_INFO, "Overlay update: %ld cells with adults removed", cells_adults_removed ); return ACTION_RUN; } +