anchor.diff:  
   //Get tile corners terrain id
   function TKMTerrain.TileCornersTerrains(aX, aY: Word): TKMWordArray;
  -const
  -  TOO_BIG_VALUE = 10000;
  -var
  -  K, L: Integer;
  +var
  +  K: Integer;
  +  TKinds: TKMTerrainKindsArray;
   begin
     SetLength(Result, 4);
  +  TKinds := TileCornersTerKinds(aX, aY);
     for K := 0 to 3 do
  -  begin
  -    Result[K] := TOO_BIG_VALUE;
  -    with gTerrain.Land[aY,aX] do
  -    begin
  -      if K in BaseLayer.Corners then
  -        Result[K] := BASE_TERRAIN[TILE_CORNERS_TERRAIN_KINDS[BaseLayer.Terrain, (K + 4 - BaseLayer.Rotation) mod 4]]
  -      else
  -        for L := 0 to LayersCnt - 1 do
  -          if K in Layer[L].Corners then
  -          begin
  -            Result[K] := BASE_TERRAIN[gRes.Sprites.GetGenTerrainInfo(Layer[L].Terrain).TerKind];
  -            Break;
  -          end;
  -    end;
  -    Assert(Result[K] <> TOO_BIG_VALUE, Format('[TileCornerTerrains] Can''t determine tile [%d:%d] terrain at Corner [%d]', [aX, aY, K]));
  -  end;
  +    Result[K] := BASE_TERRAIN[TKinds[K]];
   end;
   
   
  
positive.code: function TKMTerrain.TileGoodForGoldMine(X,Y: Word): Boolean;
  var
    CornersTKinds: TKMTerrainKindsArray;
    CornersTerrains: TKMWordArray;
  begin
    Result :=
      (fTileset.TileIsGoodForGoldMine(Land[Y,X].BaseLayer.Terrain)
        and (Land[Y,X].BaseLayer.Rotation mod 4 = 0)); //only horizontal mountain edges allowed
    if not Result then
    begin
      CornersTerrains := TileCornersTerrains(X, Y);
      CornersTKinds := TileCornersTerKinds(X, Y);
      Result :=
            (CornersTKinds[0] in [tkGold, tkGoldMount])
        and (CornersTKinds[1] in [tkGold, tkGoldMount])
        and fTileset.TileIsRoadable(CornersTerrains[2])
        and fTileset.TileIsRoadable(CornersTerrains[3]);
    end;
  end;
  
  
negative.code: function TKMTerrain.TileGoodForIronMine(X,Y: Word): Boolean;
  var
    CornersTKinds: TKMTerrainKindsArray;
  begin
    Result :=
      (fTileset.TileIsGoodForIronMine(Land[Y,X].BaseLayer.Terrain)
        and (Land[Y,X].BaseLayer.Rotation mod 4 = 0)); //only horizontal mountain edges allowed
    if not Result then
    begin
      CornersTKinds := TileCornersTerKinds(X, Y);
      Result :=
            (CornersTKinds[0] in [tkIron, tkIronMount])
        and (CornersTKinds[1] in [tkIron, tkIronMount])
        and fTileset.TileIsRoadable(BASE_TERRAIN[CornersTKinds[2]])
        and fTileset.TileIsRoadable(BASE_TERRAIN[CornersTKinds[3]]);
    end;
  end;
  
  