diff --git a/astar/Astar.cs b/astar/Astar.cs index 9e665bb..398f9df 100644 --- a/astar/Astar.cs +++ b/astar/Astar.cs @@ -85,9 +85,9 @@ namespace astar if(!way.AccessPermitted()) continue; - if(wayId.Value && way.GetDirection() == (fromStart ? WayDirection.Forwards : WayDirection.Backwards) && car) + if(wayId.Value && way.GetDirection() == (fromStart ? WayDirection.Backwards : WayDirection.Forwards) && car) continue; - if(!wayId.Value && way.GetDirection() == (fromStart ? WayDirection.Backwards : WayDirection.Forwards) && car) + if(!wayId.Value && way.GetDirection() == (fromStart ? WayDirection.Forwards : WayDirection.Backwards) && car) continue; Node neighborNode = graph.Nodes[neighborId];