pattern 'P' now uses permanent_long_distances

This commit is contained in:
Zeno Rogue 2019-12-23 20:52:25 +01:00
parent 97ea8f8c4b
commit 94fd788316
2 changed files with 5 additions and 2 deletions

View File

@ -935,7 +935,7 @@ EX int heptdistance(cell *c1, cell *c2) {
map<pair<cell*, cell*>, int> saved_distances;
set<cell*> keep_distances_from;
EX set<cell*> keep_distances_from;
set<cell*> dists_computed;

View File

@ -1635,7 +1635,10 @@ EX namespace patterns {
return res;
}
case 'P': {
int d = celldistance(c, currentmap->gamestart()->move(0));
cell *s = currentmap->gamestart()->move(0);
if(yendor::exhaustive_distance_appropriate() && !keep_distances_from.count(s))
permanent_long_distances(s);
int d = celldistance(s, c);
color_t res = distcolors[d];
if(d > 3) res |= 0x1000000;
return res;