mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
better checking of pathlock
This commit is contained in:
parent
5dbda4c896
commit
f8c13ea531
@ -89,6 +89,7 @@ EX cell *pd_from;
|
|||||||
EX int pd_range;
|
EX int pd_range;
|
||||||
|
|
||||||
EX void onpath(cell *c, int d) {
|
EX void onpath(cell *c, int d) {
|
||||||
|
if(!pathlock) { println(hlog, "onpath without pathlock"); }
|
||||||
c->pathdist = d;
|
c->pathdist = d;
|
||||||
pathq.push_back(c);
|
pathq.push_back(c);
|
||||||
}
|
}
|
||||||
@ -117,6 +118,7 @@ EX void compute_graphical_distance() {
|
|||||||
pd_range = sr;
|
pd_range = sr;
|
||||||
c1->pathdist = 0;
|
c1->pathdist = 0;
|
||||||
pathq.push_back(pd_from);
|
pathq.push_back(pd_from);
|
||||||
|
pathlock++;
|
||||||
|
|
||||||
for(int qb=0; qb<isize(pathq); qb++) {
|
for(int qb=0; qb<isize(pathq); qb++) {
|
||||||
cell *c = pathq[qb];
|
cell *c = pathq[qb];
|
||||||
@ -126,6 +128,8 @@ EX void compute_graphical_distance() {
|
|||||||
if(c1->pathdist == PINFD)
|
if(c1->pathdist == PINFD)
|
||||||
onpath(c1, c->pathdist + 1);
|
onpath(c1, c->pathdist + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pathlock--;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int max_radius = 16;
|
const int max_radius = 16;
|
||||||
|
Loading…
Reference in New Issue
Block a user