diff --git a/src/cats/overlays/overlay_exclusion.c b/src/cats/overlays/overlay_exclusion.c index c82960b7d07e43a607345c0db63ec07ba203cd56..5e5aa3348d0e980fdf333d893913b826a59f8018 100644 --- a/src/cats/overlays/overlay_exclusion.c +++ b/src/cats/overlays/overlay_exclusion.c @@ -58,18 +58,23 @@ void destroy_excluded_cells(const struct cats_configuration *conf, struct cats_g for (cats_dt_coord col = 0; col < cols; col++) { if (cell_excluded_by_overlay(conf, row, col) == false) continue; - destroyed_cell_count += 1; + cats_dt_population old_population = get_adult_population(grid, row, col); if (grid->param.default_demographics) { + set_population_ignore_cc(grid, row, col, 0); // destroy_excluded_cells destroy_plant_cell(grid, row, col); + if (old_population) destroyed_cell_count += 1; } else { + bool destroyed = false; for (int32_t i = 0; i < conf->modules.count; i++) { cats_cell_function destroy = grid->param.module_data[i].cell_destroyed_action; if (destroy != NULL) { destroy(grid->conf, grid, row, col, 0); + destroyed = true; } } + if (old_population && destroyed) destroyed_cell_count += 1; } }