What I want to achieve is the player moving to the touched position on a 2D grid-based game, stopping at the last reachable spot if the target position is unreachable. What is the strategy usually adopted in these cases? Should I implement a specific path finding algorithm for the player?
This question on partial path-finding presents one solution - modify your path finding algorithm to remember the node visited that had the closest estimated distance to the target. Eventually, the path-finding will fail to get a route to the target (since it was unreachable), but you will have a path to the closest point encountered while it searched.