Don't iterate illogical neighbors in pathfinding