1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-01 21:10:35 +00:00

rulegen:: better debugging on solid

This commit is contained in:
Zeno Rogue 2021-12-24 23:11:33 +01:00
parent 31272587b5
commit 2af34b84f2

View File

@ -405,6 +405,8 @@ EX void delete_tmap() {
/* used in the debugger */ /* used in the debugger */
EX vector<twalker> debuglist; EX vector<twalker> debuglist;
EX vector<twalker> solid_errors_list;
/* === distances === */ /* === distances === */
bool no_errors = false; bool no_errors = false;
@ -493,7 +495,8 @@ EX void shortcut_found(tcell *c, tcell *alt, vector<twalker> &walkers, vector<tw
EX void find_new_shortcuts(tcell *c, int d, tcell *alt, int newdir, int delta) { EX void find_new_shortcuts(tcell *c, int d, tcell *alt, int newdir, int delta) {
debuglist.push_back(c); if(!solid_errors) debuglist = {};
solid_errors_list.push_back(c);
solid_errors++; solid_errors++;
all_solid_errors++; all_solid_errors++;
check_timeout(); /* may freeze no this */ check_timeout(); /* may freeze no this */
@ -651,6 +654,8 @@ EX void handle_distance_errors() {
if(b && !no_errors) { if(b && !no_errors) {
sidecache.clear(); sidecache.clear();
if(flags & w_always_clean) clean_data(); if(flags & w_always_clean) clean_data();
debuglist = solid_errors_list;
solid_errors_list = {};
throw hr_solid_error(); throw hr_solid_error();
} }
} }