map no longer disappears suddenly and irreparably if you scroll into the invisible region

This commit is contained in:
Zeno Rogue 2018-04-23 13:20:36 +02:00
parent f9b03013c1
commit 70bfe718ef
3 changed files with 4 additions and 1 deletions

View File

@ -1486,6 +1486,7 @@ void clearCellMemory() {
allmaps.clear();
last_cleared = NULL;
saved_distances.clear();
pd_from = NULL;
}
auto cellhooks = addHook(clearmemory, 500, clearCellMemory);

View File

@ -2747,7 +2747,7 @@ cell *pd_from;
int pd_range;
void compute_graphical_distance() {
cell *c1 = centerover.c ? centerover.c : cwt.c;
cell *c1 = centerover.c ? centerover.c : pd_from ? pd_from : cwt.c;
int sr = get_sightrange_ambush();
if(pd_from == c1 && pd_range == sr) return;
for(auto c: pathq) c->pathdist = PINFD;
@ -2761,6 +2761,7 @@ void compute_graphical_distance() {
for(int qb=0; qb<size(pathq); qb++) {
cell *c = pathq[qb];
if(c->pathdist == pd_range) break;
if(qb == 0) forCellCM(c1, c) ;
forCellEx(c1, c)
if(c1->pathdist == PINFD)
c1->pathdist = c->pathdist + 1,

View File

@ -3268,3 +3268,4 @@ ld master_to_c7_angle();
extern int mutantphase;
void resize_screen_to(int x, int y);
extern bool canvas_invisible;
extern cell *pd_from;