no more barrows on the boundary of Burial
This commit is contained in:
parent
c6a63f121e
commit
31daa605f2
41
landgen.cpp
41
landgen.cpp
|
@ -480,21 +480,34 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
||||||
case laBurial:
|
case laBurial:
|
||||||
if(d == 9) {
|
if(d == 9) {
|
||||||
if(hrand(5000) < 25 && celldist(c) >= 5 && !safety) {
|
if(hrand(5000) < 25 && celldist(c) >= 5 && !safety) {
|
||||||
c->item = itBarrow;
|
bool goodland = true;
|
||||||
c->landparam = 2 + hrand(2);
|
|
||||||
c->wall = waBarrowDig;
|
|
||||||
forCellCM(c2, c) c2->wall = waBarrowWall, c2->item = itNone;
|
|
||||||
cell *c2 = createMov(c, hrand(c->type));
|
cell *c2 = createMov(c, hrand(c->type));
|
||||||
c2->wall = waBarrowDig;
|
for(auto cx: {c, c2})
|
||||||
forCellCM(c3, c2) {
|
forCellCM(c3,cx) {
|
||||||
if(c3 == c || isNeighbor(c3, c)) continue;
|
if(c3->land != laNone && c3->land != laBurial)
|
||||||
bool adj = false;
|
goodland = false;
|
||||||
forCellEx(c4, c)
|
if(c3->bardir != NODIR && c3->bardir != NOBARRIERS)
|
||||||
if(c4 != c2 && isNeighborCM(c3, c4)) adj = true;
|
goodland = false;
|
||||||
if(adj)
|
}
|
||||||
c3->wall = waBarrowDig;
|
if(goodland) {
|
||||||
else
|
c->item = itBarrow;
|
||||||
c3->wall = waBarrowWall, c3->item = itNone;
|
c->landparam = 2 + hrand(2);
|
||||||
|
c->wall = waBarrowDig;
|
||||||
|
forCellCM(c3, c)
|
||||||
|
c3->wall = waBarrowWall, c3->item = itNone,
|
||||||
|
c3->bardir = NOBARRIERS;
|
||||||
|
c2->wall = waBarrowDig;
|
||||||
|
forCellCM(c3, c2) {
|
||||||
|
if(c3 == c || isNeighbor(c3, c)) continue;
|
||||||
|
c3->bardir = NOBARRIERS;
|
||||||
|
bool adj = false;
|
||||||
|
forCellEx(c4, c)
|
||||||
|
if(c4 != c2 && isNeighborCM(c3, c4)) adj = true;
|
||||||
|
if(adj)
|
||||||
|
c3->wall = waBarrowDig;
|
||||||
|
else
|
||||||
|
c3->wall = waBarrowWall, c3->item = itNone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue