1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-30 12:00:35 +00:00

gp:: improved debug

This commit is contained in:
Zeno Rogue 2021-09-30 13:10:52 +02:00
parent aeb889119d
commit 9ffdf3aa67
2 changed files with 6 additions and 5 deletions

View File

@ -272,7 +272,7 @@ void hrmap_standard::find_cell_connection(cell *c, int d) {
else if(GOLDBERG) { else if(GOLDBERG) {
gp::extend_map(c, d); gp::extend_map(c, d);
if(!c->move(d)) { if(!c->move(d)) {
printf("extend failed to create for %p/%d\n", hr::voidp(c), d); println(hlog, "extend failed to create for ", cellwalker(c, d));
exit(1); exit(1);
} }
hybrid::link(); hybrid::link();

View File

@ -235,11 +235,11 @@ EX namespace gp {
auto wcw = get_localwalk(wc, dir); auto wcw = get_localwalk(wc, dir);
auto& wc1 = get_mapping(at + eudir(dir)); auto& wc1 = get_mapping(at + eudir(dir));
DEBB0(DF_GP, (format(" md:%02d s:%d", wc.mindir, wc.cw.spin)); ) DEBB0(DF_GP, (format(" md:%02d s:%d", wc.mindir, wc.cw.spin)); )
DEBB0(DF_GP, (" connection ", at, "/", dir, " ", wc.cw+dir, "=", wcw, " ~ ", at+eudir(dir), "/", dir1); ) DEBB0(DF_GP, (" connection ", at, "/", dir, " ", wc.cw+dir, "=", wcw, " ~ ", at+eudir(dir), "/", dir1, " "); )
if(!wc1.cw.at) { if(!wc1.cw.at) {
wc1.start = wc.start; wc1.start = wc.start;
if(peek(wcw)) { if(peek(wcw)) {
DEBB0(DF_GP, ("(pulled) "); ) DEBB0(DF_GP, (" (pulled) "); )
set_localwalk(wc1, dir1, wcw + wstep); set_localwalk(wc1, dir1, wcw + wstep);
if(do_adjm) wc1.adjm = wc.adjm * get_adj(wcw.at, wcw.spin); if(do_adjm) wc1.adjm = wc.adjm * get_adj(wcw.at, wcw.spin);
} }
@ -249,14 +249,14 @@ EX namespace gp {
set_localwalk(wc1, dir1, wcw + wstep); set_localwalk(wc1, dir1, wcw + wstep);
if(do_adjm) wc1.adjm = wc.adjm; if(do_adjm) wc1.adjm = wc.adjm;
spawn++; spawn++;
DEBB0(DF_GP, ("(created) "); ) DEBB0(DF_GP, (" (created) "); )
} }
} }
DEBB0(DF_GP, (wc1.cw+dir1, " ")); DEBB0(DF_GP, (wc1.cw+dir1, " "));
auto wcw1 = get_localwalk(wc1, dir1); auto wcw1 = get_localwalk(wc1, dir1);
if(peek(wcw)) { if(peek(wcw)) {
if(wcw+wstep != wcw1) { if(wcw+wstep != wcw1) {
DEBB(DF_GP, ("FAIL: ", wcw, " / ", wcw1); exit(1); ) DEBB(DF_GP, ("FAIL: ", wcw, " connected to ", wcw+wstep, " not to ", wcw1); exit(1); )
} }
else { else {
DEBB(DF_GP, ("(was there)")); DEBB(DF_GP, ("(was there)"));
@ -296,6 +296,7 @@ EX namespace gp {
EX void extend_map(cell *c, int d) { EX void extend_map(cell *c, int d) {
DEBB(DF_GP, ("EXTEND ",c, " ", d)); DEBB(DF_GP, ("EXTEND ",c, " ", d));
indenter ind(2);
if(c->master->c7 != c) { if(c->master->c7 != c) {
while(c->master->c7 != c) { while(c->master->c7 != c) {
DEBB(DF_GP, (c, " direction 0 corresponds to ", c->move(0), " direction ", c->c.spin(0)); ) DEBB(DF_GP, (c, " direction 0 corresponds to ", c->move(0), " direction ", c->c.spin(0)); )