1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-07-06 11:32:49 +00:00

reg3:: bounded_celldistance used in create_patterns()

This commit is contained in:
Zeno Rogue 2020-01-28 15:16:50 +01:00
parent 100b8f3534
commit 96f872dd18

View File

@ -377,8 +377,8 @@ EX namespace reg3 {
void create_patterns() { void create_patterns() {
// change the geometry to make sure that the correct celldistance is used DEBB(DF_GEOM, ("creating pattern = ", isize(allh)));
dynamicval<eGeometry> g(geometry, gFieldQuotient);
// also, strafe needs currentmap // also, strafe needs currentmap
dynamicval<hrmap*> c(currentmap, this); dynamicval<hrmap*> c(currentmap, this);
@ -387,18 +387,18 @@ EX namespace reg3 {
cell *a = gamestart(); cell *a = gamestart();
cell *b = a; cell *b = a;
for(cell *c: allcells()) for(cell *c: allcells())
if(hr::celldistance(a, c) == 5) { if(bounded_celldistance(a, c) == 5) {
b = c; b = c;
break; break;
} }
for(cell *c: allcells()) for(cell *c: allcells())
if(hr::celldistance(a, c) > hr::celldistance(b, c)) if(bounded_celldistance(a, c) > bounded_celldistance(b, c))
c->master->zebraval |= 1; c->master->zebraval |= 1;
// Vineyard in 534 // Vineyard in 534
b = (cellwalker(a, 0) + wstep + rev + wstep).at; b = (cellwalker(a, 0) + wstep + rev + wstep).at;
for(cell *c: allcells()) for(cell *c: allcells())
if(hr::celldistance(a, c) == hr::celldistance(b, c)) if(bounded_celldistance(a, c) == bounded_celldistance(b, c))
c->master->zebraval |= 2; c->master->zebraval |= 2;
} }
@ -406,7 +406,7 @@ EX namespace reg3 {
// Emerald in 534 // Emerald in 534
cell *a = gamestart(); cell *a = gamestart();
for(cell *c: allcells()) for(cell *c: allcells())
if(hr::celldistance(a, c) > 3) if(bounded_celldistance(a, c) > 3)
c->master->zebraval |= 1; c->master->zebraval |= 1;
// Vineyard in 435 // Vineyard in 435