From bc06f387fc0ef76e4a55be9e86302aebf64b455a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 22 Jun 2018 19:36:04 +0200 Subject: [PATCH] fixed some issues with the generation of Land of Storms in other geometries --- bigstuff.cpp | 4 +++- landgen.cpp | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bigstuff.cpp b/bigstuff.cpp index dfc7dc87..d61631db 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -1122,8 +1122,10 @@ void buildBigStuff(cell *c, cell *from) { heptagon *h = createAlternateMap(c, 2, hsA); if(h) clearing::bpdata[h].root = NULL; } + + bool alts_okay = (S3 == 3 || (nonbitrunc && !gp::on)); - if(c->land == laStorms && ctof(c) && hrand(2000) < 1000 && horo_ok() && !randomPatternsMode) { + if(alts_okay && c->land == laStorms && ctof(c) && hrand(2000) < 1000 && horo_ok() && !randomPatternsMode) { heptagon *h = createAlternateMap(c, 2, hsA); if(h) h->alt->emeraldval = hrand(2); } diff --git a/landgen.cpp b/landgen.cpp index 43f19e9e..373f9db3 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -1144,7 +1144,7 @@ void giantLandSwitch(cell *c, int d, cell *from) { break; case laStorms: { - bool randstorm = hyperbolic_not37 || gp::on || quotient == 2; + bool randstorm = hyperbolic_not37 || gp::on || (quotient && geometry != gZebraQuotient); if(d == 9) { if(torus) { @@ -1223,11 +1223,19 @@ void giantLandSwitch(cell *c, int d, cell *from) { if(c->mov[i] && c->mov[i]->land != laStorms && c->mov[i]->land != laNone) c->wall = waNone; } - if(d == 8 && randstorm) { + if(d == BARLEV && randstorm) { c->landparam = hrand(1000000); } - if(d == 7 && randstorm) { - forCellEx(c2, c) if(c2->landparam < c->landparam) setdist(c2, 7, c); + if(d == BARLEV-1 && randstorm) { + /* static int stormlevel, stormgroup; + if(!stormlevel) stormgroup = 0; + stormlevel++; stormgroup++; */ + forCellEx(c2, c) if(c2->land == laStorms && c2->mpdist >= BARLEV && c2->landparam > c->landparam) { + setdist(c2, BARLEV-1, c); + } + /* + stormlevel--; + if(stormlevel == 0) printf("stormgroup = %4d (cellcount = %6d hcount = %6d)\n", stormgroup, cellcount, heptacount); */ bool bad = false; forCellEx(c2, c) if(c2->land != laStorms) bad = true; if(!bad) { @@ -1245,7 +1253,7 @@ void giantLandSwitch(cell *c, int d, cell *from) { else if(wallsnow == 1 && slp == 0) { c->wall = waSandstone; } - else if(slp == 1 && wallsnow == 0) + else if(wallsnow) c->landparam = 1; } }