From 0b0ad4abe36caf6ab3a32cbb6700cba2a979ff1b Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 8 May 2024 21:16:47 +0200 Subject: [PATCH] made bfs in 3D always know nearby cells even if gmatrix not known --- environment.cpp | 2 +- reg3.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.cpp b/environment.cpp index 56e7cf95..d2142896 100644 --- a/environment.cpp +++ b/environment.cpp @@ -368,7 +368,7 @@ EX void bfs() { c2->wall = waSea; if(c2 && signed(c2->cpdist) > d+1) { - if(WDIM == 3 && !gmatrix.count(c2)) { + if(WDIM == 3 && (d > 2 && !gmatrix.count(c2))) { if(!first7) first7 = qb; continue; } diff --git a/reg3.cpp b/reg3.cpp index 6faa2af6..2db0393c 100644 --- a/reg3.cpp +++ b/reg3.cpp @@ -2585,7 +2585,7 @@ int celldistance_534(cell *c1, cell *c2) { vector s1 = {c1}; vector s2 = {c2}; - int best = 99999999; + int best = DISTANCE_UNKNOWN; int d0 = 0; auto go_nearer = [&] (vector& v, int& d) {