mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-04 14:30:35 +00:00
generateAlts: fixed generation in some geometries
This commit is contained in:
parent
570272fd7a
commit
32a5368241
@ -204,14 +204,20 @@ EX heptagon *createAlternateMap(cell *c, int rad, hstate firststate, int special
|
|||||||
// check for direction
|
// check for direction
|
||||||
int gdir = -1;
|
int gdir = -1;
|
||||||
for(int i=0; i<c->type; i++) {
|
for(int i=0; i<c->type; i++) {
|
||||||
|
if(!reg3::geometry_has_tree_structure()) {
|
||||||
if(c->move(i) && c->move(i)->mpdist < c->mpdist) gdir = i;
|
if(c->move(i) && c->move(i)->mpdist < c->mpdist) gdir = i;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
/* mpdist may be incorrect */
|
||||||
|
if(c->move(i) && c->move(i)->master->distance < c->master->distance) gdir = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(gdir < 0) return NULL;
|
if(gdir < 0) return NULL;
|
||||||
|
|
||||||
// non-crossing in weird hyperbolic
|
// non-crossing in weird hyperbolic
|
||||||
if(weirdhyperbolic) {
|
if(weirdhyperbolic) {
|
||||||
if(c->bardir == NOBARRIERS) return NULL;
|
if(c->bardir == NOBARRIERS) return NULL;
|
||||||
forCellEx(c1, c) if(c1->bardir == NOBARRIERS) return NULL;
|
forCellCM(c1, c) if(c1->bardir == NOBARRIERS) return NULL;
|
||||||
if(IRREGULAR)
|
if(IRREGULAR)
|
||||||
for(int i=0; i<S7; i++)
|
for(int i=0; i<S7; i++)
|
||||||
if(createStep(c->master, i)->c7->bardir != NODIR)
|
if(createStep(c->master, i)->c7->bardir != NODIR)
|
||||||
@ -227,7 +233,6 @@ EX heptagon *createAlternateMap(cell *c, int rad, hstate firststate, int special
|
|||||||
|
|
||||||
// okay, let's go then!
|
// okay, let's go then!
|
||||||
cellwalker bf(c, gdir);
|
cellwalker bf(c, gdir);
|
||||||
if(PURE) bf += rev;
|
|
||||||
std::vector<cell *> cx(rad+1);
|
std::vector<cell *> cx(rad+1);
|
||||||
for(int i=0; i<rad; i++) {
|
for(int i=0; i<rad; i++) {
|
||||||
cx[i] = bf.at;
|
cx[i] = bf.at;
|
||||||
|
Loading…
Reference in New Issue
Block a user