1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-20 11:54:48 +00:00

fixed Euclidean celldistalt

This commit is contained in:
Zeno Rogue 2020-05-29 01:52:47 +02:00
parent 98b1e659a5
commit 4f1742f21f
2 changed files with 8 additions and 2 deletions

View File

@ -511,7 +511,7 @@ EX int celldistAlt(cell *c) {
return celldist(c) - 3;
}
#if MAXMDIM >= 4
if(euc::in(3)) return euc::dist_alt(c);
if(euc::in()) return euc::dist_alt(c);
if(hyperbolic && WDIM == 3 && !reg3::in_rule())
return reg3::altdist(c->master);
#endif

View File

@ -339,6 +339,10 @@ EX namespace euc {
}
EX int dist_alt(cell *c) {
if(WDIM == 2) {
auto v = full_coords2(c);
return euclidAlt(v.first, v.second);
}
if(specialland == laCamelot) return dist_relative(c) + roundTableRadius(c);
auto v = cubemap()->ispacemap[c->master];
if(S7 == 6) return v[2];
@ -391,8 +395,10 @@ EX namespace euc {
}
}
EX int celldistance(cell *c1, cell *c2) {
EX int celldistance(cell *c1, cell *c2) {
auto cm = cubemap();
if(GDIM == 2)
return dist(full_coords2(c1), full_coords2(c2));
return celldistance(basic_canonicalize(cm->ispacemap[c1->master] - cm->ispacemap[c2->master]));
}