mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-03-31 15:57:02 +00:00
rulegen:: debug get_parent_dir
This commit is contained in:
parent
dd79a01f02
commit
43aec99cd8
@ -41,6 +41,8 @@ const int MYSTERY = 31999;
|
|||||||
const int MYSTERY_DIST = 31998;
|
const int MYSTERY_DIST = 31998;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
EX bool parent_debug;
|
||||||
|
|
||||||
/* === tcell === */
|
/* === tcell === */
|
||||||
|
|
||||||
/** number of tcells created */
|
/** number of tcells created */
|
||||||
@ -563,9 +565,12 @@ EX int get_parent_dir(tcell *c) {
|
|||||||
for(int i=0; i<n; i++) {
|
for(int i=0; i<n; i++) {
|
||||||
tcell *c1 = c->cmove(i);
|
tcell *c1 = c->cmove(i);
|
||||||
be_solid(c1);
|
be_solid(c1);
|
||||||
|
if(parent_debug) println(hlog, "direction = ", i, " distance = ", c1->dist);
|
||||||
if(c1->dist < d) nearer.push_back(i);
|
if(c1->dist < d) nearer.push_back(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(parent_debug) println(hlog, "nearer = ", nearer, " n=", n, " k=", k);
|
||||||
|
|
||||||
auto oc = c;
|
auto oc = c;
|
||||||
ufindc(c); if(d != c->dist || oc != c) {
|
ufindc(c); if(d != c->dist || oc != c) {
|
||||||
return get_parent_dir(c);
|
return get_parent_dir(c);
|
||||||
@ -577,6 +582,8 @@ EX int get_parent_dir(tcell *c) {
|
|||||||
if(beats(ne, bestd))
|
if(beats(ne, bestd))
|
||||||
bestd = ne;
|
bestd = ne;
|
||||||
|
|
||||||
|
if(parent_debug) for(auto ne: nearer) println(hlog, "beats", tie(ne, bestd), " = ", beats(ne, bestd));
|
||||||
|
|
||||||
for(auto ne: nearer)
|
for(auto ne: nearer)
|
||||||
if(ne != bestd && beats(ne, bestd)) {
|
if(ne != bestd && beats(ne, bestd)) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user