Figuring out something weird about the Pathing::random_walk code.

This commit is contained in:
Zed A. Shaw 2025-03-13 23:03:14 -04:00
parent ee804581a8
commit 77f2e94515
3 changed files with 30 additions and 10 deletions

View file

@ -106,14 +106,17 @@ void Autowalker::path_fail(Matrix& bad_paths, Point pos) {
}
bool Autowalker::path_player(Pathing& paths, Point& target_out) {
bool found = paths.random_walk(target_out, false, PATHING_TOWARD);
bool found = paths.random_walk(target_out, false, PATHING_TOWARD, 4, 8);
if(!found) {
fmt::println("4/8 NOT FOUND");
// failed to find a linear path, try diagonal
if(!paths.random_walk(target_out, false, PATHING_TOWARD, MOVE_DIAGONAL)) {
if(!paths.random_walk(target_out, false, PATHING_TOWARD, 8, 8)) {
path_fail(paths.$paths, target_out);
return false;
}
} else {
fmt::println("4/8 YES FOUND");
}
if(!fsm.$level.map->can_move(target_out)) {