It is only possible to set lake_height to 0 or 8 with the parameter in simuconf.tab
I think this not intended because this value can be set in the GUI from "Water level"(means sea level) to 127
settings.cc at line 1286
Quote
tree_distribution = contents.get_int_clamped( "tree_distribution", tree_distribution, TREE_DIST_NONE, TREE_DIST_COUNT-1 );
lake_height = (contents.get_int("no_lakes", (lake_height == 0) )) ? 0 : 8;
lake_height = contents.get_int_clamped("lake_height", lake_height, 0, INT_MAX );
The last line looks ok, but why this doesn't work?
Form 0 to INT_MAX is allowed. The value can negativ also in the GUI.
The reason: there are more pass throw the code.
One for the pak specific simuconf.tab and then for the user-specific simuconf.tab.
) ? 0 : 8; set lake_height to 0 or 8 no matter if "no_lakes" is set or not.
QuoteMessage: simu_main(): Parsing /usr/share/simutrans/PAK128.german/config/simuconf.tab
ERROR: set lake_height: lake_height = 2 values
Message: simu_main(): Parsing /home/martin/.local/share/simutrans/simuconf.tab
ERROR: set lake_height: lake_height = 8 values
One possible solution is delete the second line with "no_lakes" at all.
Maybe change
clamped("lake_height", lake_height, -2, 127 );
or accordingly climates.cc
clamped("lake_height", lake_height,sets->get_groundwater(), 127 );
I think originally lake_height was meant as "lake height above groundwater" but the actual algoritm now uses lake_height as absolute height. I've changed lake_height back to be groundwater-relative in r11950 for now (so negative values for lake_height will disable lakes).
R11950 alters the program's behavior especially when the value is set via the GUI. However, the validation logic for this value in `climates.cc` was not updated and still assumes an absolute value. To be considered that all other altitude values in the GUI window are absolute values, rather than being relative to sea level.
However, this change does not resolve the bug described above that prevents the value from being specified properly via `simuconfig.tab`.
(https://makie.de/lakehight.png)