No ... Did not crashic111 wrote:This is the beginning of the main calculation function.
The question is, does it crash if you (after you made a copy of the file) remove everything but the very beginning of that function? E.g. such that it looks like:
If yes,Code: Select all
bool RainfallRiverGenerator::GenerateRivers() { HeightIndex *height_index = new HeightIndex(); delete height_index; return false; }
I am not sure that I did this correctly, but the following crashed as before.If no, you might do the same, but keep the code block above including the number of lower tiles calculation, followed again by
Code: Select all
delete lower_iterator; delete height_index; return false; }
Code: Select all
bool RainfallRiverGenerator::GenerateRivers()
{
HeightIndex *height_index = new HeightIndex();
SetGeneratingWorldProgress(GWP_RAINFALL_NUMBER_OF_LOWER, (MapSize() / 1000) + 1);
DEBUG(map, RAINFALL_PROGRESS_LOG_LEVEL, "SetGeneratingWorldProgress: GWP_RAINFALL_NUMBER_OF_LOWER = %u", (MapSize() / 1000) + 1);
/* For each tile, calculate the number of reachable lower tiles. See the iterator for a more detailed
* description of that concept. Start at the lowest parts of the map */
NumberOfLowerHeightIterator *lower_iterator = new NumberOfLowerHeightIterator(height_index);
for (uint h = 0; h <= _settings_game.construction.max_heightlevel; h++) {
/* For a particular heightlevel, first look at the flat tiles, then at those with height difference 1,
* and finally at the steep tiles. Having a look at map geometry, this order does what we want, beside
* the fact that the heightlevel is always the one of the north corner. */
lower_iterator->Calculate(h, HLIM_ZERO_OR_ONE_CORNER_RAISED);
lower_iterator->Calculate(h, HLIM_TWO_OR_THREE_CORNERS_RAISED);
lower_iterator->Calculate(h, HLIM_STEEP);
}
int *calculated_number_of_lower_tiles = lower_iterator->GetNumberOfLowerTiles();
delete lower_iterator;
delete height_index;
return false;
}