way better map/maze debug output.

This commit is contained in:
Zed A. Shaw 2026-03-15 00:09:47 -04:00
parent 3394de064c
commit f304538325
8 changed files with 72 additions and 24 deletions

View file

@ -52,8 +52,18 @@ void WorldBuilder::generate_map() {
]
)"_json;
auto [maze, valid] = maze::script($map, script);
dbc::check(valid, "invalid maze");
int i = 0;
for(; i < 10; i++) {
auto [maze, valid] = maze::script($map, script);
if(valid) {
break;
} else {
maze.dump(fmt::format("FAILED width={}", $map.width()), true);
}
}
dbc::check(i < 10, "failed to find a valid map after 10 attempts");
$map.init_tiles();
stylize_rooms();