This patch fixes a crash which occurs when generating a map with the attached map parameters.
This should never happen, since just before all tie with single or no climates are handled. Moreover, climate from height arrz is set to emperate, if there is no climate at all. I will investigate further.
I encountered this error also thanks for fixing ceeac
Yes, but this is fixing symptoms, the real error happened elsewhere before.
I committed this fix (with small change) in r9164. Symptons are cured...
I think I fixed the original bug in r9167
I'm still getting issues here - when you increase the water level in the landscape settings window the climate setting heights aren't updated correctly. As a result out of bounds array accesses were occurring which didn't generate an exception immediately but corrupted zeiger and viewport pointers causing issues later. This patch handles this window more robustly to ensure that negative values aren't passed as an array offset, and also addresses what I think is an issue relating to an incorrect height - on one comparison the difference from groundwater was used rather than the absolute height value. Should be ok to commit just putting it here first to check people are happy with it - if I don't hear any negatives will commit tomorrow.
Changing the groundwater height should lead to all bad effects also with existing maps, since the lookup of climates by height after a change of groundwater level without recalculating the table will lead to wrong offsets anyway. Changing climates was never a good idea after starting a game
Quote from: prissi on July 14, 2020, 02:51:19 PM
Changing the groundwater height should lead to all bad effects also with existing maps, since the lookup of climates by height after a change of groundwater level without recalculating the table will lead to wrong offsets anyway. Changing climates was never a good idea after starting a game
To be clear the errors I was getting was when creating a new map with a different groundwater height from that previously used in settings. The climate window appeared to update climate boundaries but didn't actually apply these values to settings, hence when the new map creation began some climates had negative offsets relative to groundwater, which then caused an out of bounds memory write. The patch forces changes to the values in the GUI to be written to settings.
Ahh, thanks, I misunderstood. Still you report got me think about the above issue as well.