anchor.diff:  end;
   
   
  +function TNavMeshPathFinding.InitPolygonRoute(aStart, aEnd: Word; out aDistance: Word; out aRoutePolygonArray: TKMWordArray): Boolean;
  +var
  +  Output: Boolean;
  +begin
  +  Result := False;
  +  fStart := aStart;
  +  fEnd := aEnd;
  +  if (fStart = High(Word)) OR (fEnd = High(Word))
  +    OR (fStart >= Length(gAIFields.NavMesh.Polygons))
  +    OR (fEnd >= Length(gAIFields.NavMesh.Polygons)) then  // Non-Existing polygon
  +    Exit;
  +  fMode := pm_ShortestWay;
  +  Output := MakeRoute();
  +  if Output then
  +  begin
  +    ReturnPolygonRoute(aDistance, aRoutePolygonArray);
  +    aRoutePolygonArray[0] := aEnd;
  +  end;
  +  Result := Output;
  +end;
  +
  +
   function TNavMeshPathFinding.InitRoute(aStart, aEnd: TKMPoint; out aDistance: Word; out aRoutePointArray: TKMPointArray): Boolean;
   var
     Output: Boolean;
   begin
     Result := False;
  -  fStart := gAIFields.NavMesh.Point2Polygon[ aStart.Y, aStart.X ];
  -  fEnd := gAIFields.NavMesh.Point2Polygon[ aEnd.Y, aEnd.X ];
  +  fStart := gAIFields.NavMesh.KMPoint2Polygon[ aStart ];
  +  fEnd := gAIFields.NavMesh.KMPoint2Polygon[ aEnd ];
     if (fStart = High(Word)) OR (fEnd = High(Word)) then  // Non-Existing polygon
       Exit;
     fMode := pm_ShortestWay;
  
positive.code: end;
  
  
  procedure TNavMeshPathFinding.ReturnRoute(out aDistance: Word; out aRoutePointArray: TKMPointArray);
  const
    USED_PENALIZATION = 40;
  var
    Count: Word;
    N, FinalN: TNavMeshNode;
  
negative.code: end;
  
  
  function TNavMeshPathFinding.ShortestPolygonRoute(aStart, aEnd: Word; out aDistance: Word; out aRoutePolygonArray: TKMWordArray): Boolean;
  begin
    Result := InitPolygonRoute(aStart, aEnd, aDistance, aRoutePolygonArray);
  end;
  
  
  function TNavMeshPathFinding.ShortestRoute(aStart, aEnd: TKMPoint; out aDistance: Word; out aRoutePointArray: TKMPointArray): Boolean;
  begin
    Result := InitRoute(aStart, aEnd, aDistance, aRoutePointArray);
  