How do I check if a npc can walk in a straight line?

  1. How do I check if it is possible for a npc to walk in a straight line to a point. If it is not possible then I want to use pathfinding but like 80% of my cases I will be able to walk straight and I want to reduce some lag. Like can it get to a point without using pathfinding then print (“walk straight”) or whatever. Thanks - Lux