Skip to content
Snippets Groups Projects
Commit e9674137 authored by Andreas Gattringer's avatar Andreas Gattringer
Browse files

fixed destroyed cell count for excluded cells

parent 0a063438
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment