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

butterflies: fix generation calculation bug

parent 48cdc222
No related branches found
No related tags found
No related merge requests found
......@@ -102,10 +102,14 @@ void bf_cell_maturation(struct cats_grid *grid, struct cats_thread_info *ts, cat
struct conf_data_butterflies *module_conf = CATS_MODULE_DATA;
float this_generation_fraction = 1.0f;
float local_generation = data->generations[row][col];
int32_t global_max_generation = module_conf->generations_max;
int32_t local_max_generation = (int32_t) ceilf(local_generation);
int32_t global_current_generation = data->generation_current;
float current_generation_float = (float) data->generation_current;
if (current_generation_float == local_generation
if (global_current_generation == global_max_generation) {
this_generation_fraction = 1.0f;
} else if (current_generation_float == local_generation
|| data->generation_current == module_conf->generations_min) {
this_generation_fraction = 1.0f;
} else if (data->generation_current == local_max_generation) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment