anchor.diff:  
   
   function TKMTerrain.TileHasParameter(X,Y: Word; aCheckTileFunc: TBooleanWordFunc; aAllow2CornerTiles: Boolean = True): Boolean;
  -var
  -  K, Cnt: Integer;
  -  Corners: TKMWordArray;
  +const
  +  PROHIBIT_TERKINDS: array[0..1] of TKMTerrainKind = (tkLava, tkAbyss);
  +var
  +  I, K, Cnt: Integer;
  +  Corners: TKMTerrainKindsArray;
   begin
     Result := False;
   
  
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:   else
    begin
      Cnt := 0;
      Corners := TileCornersTerKinds(X,Y);
      for K := 0 to 3 do
      begin
        for I := 0 to High(PROHIBIT_TERKINDS) do
          if Corners[K] = PROHIBIT_TERKINDS[I] then
            Exit(False);
  
        if aCheckTileFunc(BASE_TERRAIN[Corners[K]]) then
          Inc(Cnt);
      end;
  
      //Consider tile has parameter if it has 3 corners with that parameter or if it has 2 corners and base layer has the parameter
      Result := (Cnt >= 3) or (aAllow2CornerTiles and (Cnt = 2) and aCheckTileFunc(Land[Y, X].BaseLayer.Terrain));
  