anchor.diff:        end;
       end;
     end;
  -
  -  function FindSeparateMines(aCityCenter: TKMPoint; aMineType: TKMHouseType; var aMineList: TKMPointTagList): Word;
  -  var
  -    I,K, Output: Integer;
  -    InfluenceArr: array of Boolean;
  -  begin
  -    Output := 0;
  -    if (aMineList.Count > 0) then
  -    begin
  -      SetLength(InfluenceArr, aMineList.Count);
  -      FillChar(InfluenceArr[0], SizeOf(InfluenceArr[0]) * Length(InfluenceArr), #0); // => False
  -      for I := 0 to aMineList.Count-1 do
  -      begin
  -        InfluenceArr[I] := True;
  -        for K := 0 to I-1 do
  -          if InfluenceArr[K] AND
  -            not (   (aMineList.Items[K].Y <> aMineList.Items[I].Y)
  -                  OR (  Abs(aMineList.Items[K].X - aMineList.Items[I].X) > (3 + Byte(aMineType = htIronMine)) )   ) then
  -          begin
  -            InfluenceArr[I] := False;
  -            break;
  -          end;
  -        if InfluenceArr[I] then
  -        begin
  -          Output := Output + 1;
  -          ScanLocArea( aCityCenter, aMineList.Items[I] );
  -        end;
  -      end;
  -    end;
  -    Result := Output;
  -  end;
  -var
  -  I, X,Y, Increment: Integer;
  +var
  +  I, X,Y, FieldCnt, BuildCnt: Integer;
     Time: Cardinal;
  -  CenterPointArr: TKMPointArray;
  -  TagList: TKMPointTagList;
  +  CenterPointArr, MineLocs: TKMPointArray;
  +  //TagList: TKMPointTagList;
     FFInitPlace: TKMFFInitPlace;
   begin
     Time := TimeGet();
     // Init city center point (storehouse / school etc.)
     CenterPointArr := GetCityCenterPoints(False);
  -
     PointsCnt := 0;
     SetLength(InitPoints,0);
  -  TagList := TKMPointTagList.Create();
     Road := TKMPointList.Create();
     try
       // Scan Resources - gold, iron
  -    TagList := GetMineLocs(htIronMine);
  -    try
  -      aIronMineCnt := FindSeparateMines(CenterPointArr[0], htIronMine, TagList);
  -    finally
  -      TagList.Free;
  -    end;
  -    TagList := GetMineLocs(htGoldMine);
  -    try
  -      aGoldMineCnt := FindSeparateMines(CenterPointArr[0], htGoldMine, TagList);
  -    finally
  -      TagList.Free;
  -    end;
  +    MineLocs := FindSeparateMineLocs(false, htIronMine);
  +    for I := 0 to Length(MineLocs) - 1 do
  +      ScanLocArea(CenterPointArr[0], MineLocs[I]);
  +    MineLocs := FindSeparateMineLocs(false, htGoldMine);
  +    for I := 0 to Length(MineLocs) - 1 do
  +      ScanLocArea(CenterPointArr[0], MineLocs[I]);
       // Scan Resources - coal
  -    //TagList := GetCoalMineLocs();
  -    TagList := TKMPointTagList.Create();
  -    try
  -      I := 0;
  -      Increment := Ceil(TagList.Count / 10.0); // Max 10 paths
  -      while (I < TagList.Count) do
  -      begin
  -        ScanLocArea(CenterPointArr[0], TagList.Items[I]);
  -        I := I + Increment;
  -      end;
  -    finally
  -      TagList.Free;
  -    end;
  +    //TagList := TKMPointTagList.Create();
  +    //try
  +    //  I := 0;
  +    //  Increment := Ceil(TagList.Count / 10.0); // Max 10 paths
  +    //  while (I < TagList.Count) do
  +    //  begin
  +    //    ScanLocArea(CenterPointArr[0], TagList.Items[I]);
  +    //    I := I + Increment;
  +    //  end;
  +    //finally
  +    //  TagList.Free;
  +    //end;
       // Scan Resources - stones
       {
       TagList := GetStoneLocs(True);
  
positive.code: 
    // Try to find potential forests only in owner's influence areas
    SparePointsCnt := 0;
    if (aForests.Count < GA_EYE_GetForests_AddRndPosition) then
      for I := 0 to Length(Polygons) - 1 do
      begin
        Ownership := gAIFields.Influences.OwnPoly[fOwner, I];
        if (Ownership > GA_EYE_GetForests_SPRndOwnLimMin)
           AND (Ownership < GA_EYE_GetForests_SPRndOwnLimMax)
           AND (SparePointsCnt < GA_EYE_GetForests_RndCount)
           AND (KaMRandom() > GA_EYE_GetForests_RndLimit) then
        begin
          Point := Polygons[I].CenterPoint;
          Cnt := 0;
          for Y := Max(1,Point.Y-2) to Min(Point.Y+2,fMapY-1) do
            for X := Max(1,Point.X-2) to Min(Point.X+2,fMapX-1) do
              if gTerrain.TileIsSoil(X,Y) AND (BuildFF.State[Y,X] in [bsBuild, bsTree, bsForest]) then
                Cnt := Cnt + 1;
          if (Cnt > GA_EYE_GetForests_MinRndSoil) then
          begin
            aForests.Add( Point, 0 );
            aForests.Tag2[ aForests.Count-1 ] := 0;
            SparePointsCnt := SparePointsCnt + 1;
          end;
        end;
      end;
  end;
  
  
  
negative.code:   UNVISITED_TILE = 0;
    VISITED_TILE = 1;
    UNVISITED_TREE = 2;
    VISITED_TREE = 3;
    UNVISITED_TREE_IN_FOREST = 4;
    VISITED_TREE_IN_FOREST = 5;
    MAX_SPARE_POINTS = 20;
  var
  