Pathfinding now returns the nodes to reach a destination in preparation for use w/AI pathfinding

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
2023-07-10 14:38:31 +00:00
parent cb24484dfe
commit debf151c46
3 changed files with 12 additions and 9 deletions
+2 -2
View File
@@ -460,6 +460,6 @@ std::vector<Buff>Player::GetBuffs(BuffType buff){
}
bool Player::CanPathfindTo(vf2d pos,vf2d targetPos,float range){
int pathLength=path.Solve_AStar(pos,targetPos,8,upperLevel);
return pathLength<8;//We'll say 7 tiles or less is close enough to 650 range. Have a little bit of wiggle room.
std::vector<vf2d>pathing=path.Solve_AStar(pos,targetPos,8,upperLevel);
return pathing.size()>0&&pathing.size()<8;//We'll say 7 tiles or less is close enough to 650 range. Have a little bit of wiggle room.
}