1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-17 18:59:59 +00:00

pattern I, and fixed the possible crashes in nearest_map and furthest_map

This commit is contained in:
Zeno Rogue 2021-07-09 14:04:04 +02:00
parent 3c7e64c66d
commit 41faa43f65

View File

@ -1608,12 +1608,12 @@ EX namespace patterns {
cell *sc = currentmap->gamestart(); cell *sc = currentmap->gamestart();
auto ac = currentmap->allcells(); auto ac = currentmap->allcells();
vector<int> bydist(20, 0); vector<int> bydist(100, 0);
vector<int> bynei(S7+1, 0); vector<int> bynei(FULL_EDGE+1, 0);
int maxd = 0; int maxd = 0;
for(cell *d: ac) { for(cell *d: ac) {
int di = celldistance(sc, d); int di = celldistance(sc, d);
bydist[di]++; if(di<100) bydist[di]++;
maxd = max(maxd, di); maxd = max(maxd, di);
} }
@ -1649,12 +1649,12 @@ EX namespace patterns {
cell *sc = currentmap->gamestart(); cell *sc = currentmap->gamestart();
auto ac = currentmap->allcells(); auto ac = currentmap->allcells();
vector<int> bydist(20, 0); vector<int> bydist(100, 0);
vector<int> bynei(S7+1, 0); vector<int> bynei(FULL_EDGE+1, 0);
int maxd = 0; int maxd = 0;
for(cell *d: ac) { for(cell *d: ac) {
int di = celldistance(sc, d); int di = celldistance(sc, d);
bydist[di]++; if(di<100) bydist[di]++;
maxd = max(maxd, di); maxd = max(maxd, di);
} }
@ -1842,6 +1842,11 @@ EX namespace patterns {
if(c == cwt.at && rwalls <= 100) r &= 0xFFFFFF; if(c == cwt.at && rwalls <= 100) r &= 0xFFFFFF;
return r; return r;
} }
case 'I': {
color_t r = 0xFFD500;
if(c->type != (variation == eVariation::dual_subcubes ? 6 : 14)) r |= 0x1000000;
return r;
}
case '^': { case '^': {
int x = c->master->fieldval & 4095; int x = c->master->fieldval & 4095;
int y = (c->master->fieldval >> 12) & 4095; int y = (c->master->fieldval >> 12) & 4095;