mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-22 23:17:04 +00:00
pattern I, and fixed the possible crashes in nearest_map and furthest_map
This commit is contained in:
parent
3c7e64c66d
commit
41faa43f65
17
pattern2.cpp
17
pattern2.cpp
@ -1608,12 +1608,12 @@ EX namespace patterns {
|
||||
|
||||
cell *sc = currentmap->gamestart();
|
||||
auto ac = currentmap->allcells();
|
||||
vector<int> bydist(20, 0);
|
||||
vector<int> bynei(S7+1, 0);
|
||||
vector<int> bydist(100, 0);
|
||||
vector<int> bynei(FULL_EDGE+1, 0);
|
||||
int maxd = 0;
|
||||
for(cell *d: ac) {
|
||||
int di = celldistance(sc, d);
|
||||
bydist[di]++;
|
||||
if(di<100) bydist[di]++;
|
||||
maxd = max(maxd, di);
|
||||
}
|
||||
|
||||
@ -1649,12 +1649,12 @@ EX namespace patterns {
|
||||
|
||||
cell *sc = currentmap->gamestart();
|
||||
auto ac = currentmap->allcells();
|
||||
vector<int> bydist(20, 0);
|
||||
vector<int> bynei(S7+1, 0);
|
||||
vector<int> bydist(100, 0);
|
||||
vector<int> bynei(FULL_EDGE+1, 0);
|
||||
int maxd = 0;
|
||||
for(cell *d: ac) {
|
||||
int di = celldistance(sc, d);
|
||||
bydist[di]++;
|
||||
if(di<100) bydist[di]++;
|
||||
maxd = max(maxd, di);
|
||||
}
|
||||
|
||||
@ -1842,6 +1842,11 @@ EX namespace patterns {
|
||||
if(c == cwt.at && rwalls <= 100) r &= 0xFFFFFF;
|
||||
return r;
|
||||
}
|
||||
case 'I': {
|
||||
color_t r = 0xFFD500;
|
||||
if(c->type != (variation == eVariation::dual_subcubes ? 6 : 14)) r |= 0x1000000;
|
||||
return r;
|
||||
}
|
||||
case '^': {
|
||||
int x = c->master->fieldval & 4095;
|
||||
int y = (c->master->fieldval >> 12) & 4095;
|
||||
|
Loading…
Reference in New Issue
Block a user