1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-27 02:20:36 +00:00

fixed a crash setting landscape_div to 0

This commit is contained in:
Zeno Rogue 2024-05-05 15:19:52 +02:00
parent 9aa15f96e1
commit 84666ade8c
2 changed files with 2 additions and 1 deletions

View File

@ -3337,6 +3337,7 @@ EX int config3 = addHook(hooks_configfile, 100, [] {
"land size in landscape structure", "land size in landscape structure",
"Each cell gets three coordinates, each of which change smoothly, using the same method as used for the generation of landscapes e.g. in Dragon Chasms. " "Each cell gets three coordinates, each of which change smoothly, using the same method as used for the generation of landscapes e.g. in Dragon Chasms. "
"Then, we find a cell of the bitruncated cubic honeycomb at these cordinates, and this cell determines which land it is. The bigger the value, the larger the lands.", 'R') "Then, we find a cell of the bitruncated cubic honeycomb at these cordinates, and this cell determines which land it is. The bigger the value, the larger the lands.", 'R')
->set_sets([] { dialog::bound_low(1); })
->set_reaction([] { if(game_active) { stop_game(); start_game(); } }); ->set_reaction([] { if(game_active) { stop_game(); start_game(); } });
param_i(curse_percentage, "curse_percentage")->editable(0, 100, 1, param_i(curse_percentage, "curse_percentage")->editable(0, 100, 1,

View File

@ -2921,7 +2921,7 @@ EX void set_land_for_geometry(cell *c) {
return; return;
} }
if(land_structure == lsLandscape) { if(land_structure == lsLandscape) {
if(landscape_div < 0) landscape_div = 1; if(landscape_div <= 0) landscape_div = 1;
array<int, 3> a; array<int, 3> a;
for(int i=0; i<3; i++) a[i] = getCdata(c, i); for(int i=0; i<3; i++) a[i] = getCdata(c, i);
auto& ld = landscape_div; auto& ld = landscape_div;