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:
+2
-2
@@ -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.
|
||||
}
|
||||
Reference in New Issue
Block a user