reg3:: changed the remaining refs to adjacent_dirs to dirdist; S7 to c->type

This commit is contained in:
Zeno Rogue 2021-07-11 16:18:04 +02:00
parent e9de3ac7d5
commit 7aec4c3cf1
3 changed files with 11 additions and 10 deletions

View File

@ -207,9 +207,9 @@ void hrmap::generateAlts(heptagon *h, int levs, bool link_cdata) {
#if MAXMDIM >= 4
EX int hrandom_adjacent(cellwalker cw) {
auto& da = currentmap->adjacent_dirs(cw);
auto& da = currentmap->dirdist(cw);
vector<int> choices = {cw.spin};
for(int a=0; a<S7; a++) if(da[a]) choices.push_back(a);
for(int a=0; a<cw.at->type; a++) if(da[a] == 1) choices.push_back(a);
return hrand_elt(choices, cw.spin);
}
#endif
@ -696,15 +696,15 @@ EX void buildEquidistant(cell *c) {
if(!cw.at->landflags) continue;
if(S7 == 6) c->landflags = 1;
else {
auto& da = currentmap->adjacent_dirs(cw);
for(int j=0; j<S7; j++) if(cw.at->move(j) && cw.at->move(j)->landparam == c->landparam - 2 && !da[j])
auto& da = currentmap->dirdist(cw);
for(int j=0; j<S7; j++) if(cw.at->move(j) && cw.at->move(j)->landparam == c->landparam - 2 && da[j] != 1)
if(c->landparam == 2 ? cw.at->move(j)->land != laEndorian : cw.at->move(j)->landparam)
c->landflags = 1;
}
}
}
else if(c->landparam == 2) {
for(int i=0; i<S7; i++) {
for(int i=0; i<c->type; i++) {
cellwalker cw(c, i);
if(!cw.peek()) continue;
cw += wstep;
@ -715,7 +715,7 @@ EX void buildEquidistant(cell *c) {
}
}
else if(c->landparam % 2 == 1) {
for(int i=0; i<S7; i++) {
for(int i=0; i<c->type; i++) {
cellwalker cw(c, i);
if(!cw.peek()) continue;
cw += wstep;
@ -723,14 +723,14 @@ EX void buildEquidistant(cell *c) {
if(!cw.at->landflags) continue;
if(S7 == 6) c->landflags = 1;
else {
auto& da = currentmap->adjacent_dirs(cw);
for(int j=0; j<S7; j++) if(cw.at->move(j) && cw.at->move(j)->landparam == c->landparam - 2 && !da[j] && cw.at->move(j)->landflags)
auto& da = currentmap->dirdist(cw);
for(int j=0; j<S7; j++) if(cw.at->move(j) && cw.at->move(j)->landparam == c->landparam - 2 && da[j] != 1 && cw.at->move(j)->landflags)
c->landflags = 1;
}
}
}
else {
for(int i=0; i<S7; i++) {
for(int i=0; i<c->type; i++) {
cellwalker cw(c, i);
if(!cw.peek()) continue;
cw += wstep;

View File

@ -531,6 +531,7 @@ EX int celldistAlt(cell *c) {
if(IRREGULAR) return irr::celldist(c, true);
#endif
if(ctof(c)) return c->master->alt->distance;
if(reg3::in()) return c->master->alt->distance;
#if CAP_GP
if(GOLDBERG) return gp::compute_dist(c, celldistAlt);
if(INVERSE) {

View File

@ -199,7 +199,7 @@ EX bool is_zebra_trapdoor(cell *c) {
return false;
}
case gSpace435: {
for(int i=0; i<S7; i++) {
for(int i=0; i<c->type; i++) {
cellwalker cw(c, i);
for(int a=0; a<3; a++) {
if(cw.at->master->fieldval == 0) return true;