fixed a freeze in spherical Dungeon

This commit is contained in:
Zeno Rogue 2019-02-06 22:18:06 +01:00
parent 381071ab4c
commit 9ebd5342ec
1 changed files with 3 additions and 2 deletions

View File

@ -445,11 +445,12 @@ int parent_id(cell *c, int which, const cellfunction& cf) {
for(int i=0; i<c->type; i++) { for(int i=0; i<c->type; i++) {
if(cf(c->cmove(i)) == d) { if(cf(c->cmove(i)) == d) {
int steps = 0;
again: again:
if(!which) return i; if(!which || steps == c->type) return i;
int i2 = c->c.fix(i+which); int i2 = c->c.fix(i+which);
if(cf(c->cmove(i2)) == d) { if(cf(c->cmove(i2)) == d) {
i = i2; goto again; i = i2; steps++; goto again;
} }
else return i; else return i;
} }