Figuring out something weird about the Pathing::random_walk code.
This commit is contained in:
parent
ee804581a8
commit
77f2e94515
3 changed files with 30 additions and 10 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue