anchor.diff:  
   
   {Take 4 neighbour heights and approach it}
  +//@Lewin: I don't like approach we use - flatten the tile without note of neighbour tiles
  +//Instead we might want to interpolate between surrounding 8 vertices (X and Y, no diagonals)
  +//Also it should be FlattenTerrain duty to preserve walkability if there are units standing
   procedure TTerrain.FlattenTerrain(Loc:TKMPoint);
   var TempH:byte;
   begin
  
positive.code: begin
    //Replace with smaller ore deposit tile (there are 2 sets of tiles, we can choose random)
    case Land[Loc.Y,Loc.X].Terrain of
      132,137: Land[Loc.Y,Loc.X].Terrain := 131 + KaMRandom(2)*5;
      131,136: Land[Loc.Y,Loc.X].Terrain := 130 + KaMRandom(2)*5;
      130,135: Land[Loc.Y,Loc.X].Terrain := 129 + KaMRandom(2)*5;
      129,134: Land[Loc.Y,Loc.X].Terrain := 128 + KaMRandom(2)*5;
      128,133: Land[Loc.Y,Loc.X].Terrain := 0;
      else     Exit;
    end;
  
    Land[Loc.Y,Loc.X].Rotation := KaMRandom(4);
  
    UpdateTransition(Loc.X,Loc.Y);   //Update these 5 transitions, but make sure that occupied tiles stay walkable
    UpdateTransition(Loc.X,Loc.Y-1); //    x
    UpdateTransition(Loc.X+1,Loc.Y); //  x X x
    UpdateTransition(Loc.X,Loc.Y+1); //    x
    UpdateTransition(Loc.X-1,Loc.Y);
  
    FlattenTerrain(Loc);
    //If tile stonemason is standing on becomes unwalkable, flatten it too so he doesn't get stuck all the time
    if not CheckHeightPass(KMPointBelow(Loc),CanWalk) then
      FlattenTerrain(KMPointBelow(Loc));
  
    RecalculatePassabilityAround(Loc);
    RebuildWalkConnect(wcWalk);
  end;
  
  
  
negative.code:             Byte(TileInMapCoords(X-1,  Y) and (TileIsStone(X-1,  Y)>0))*8;
  
      //Don't make units become stuck
      //@Lewin: I can't remember why do we check it here?
      //Tile can't possibly become unwalkable if it was walkable before, Stone deposit always becomes less, not more
      //Any idea why it is here?
      if not HasUnit(KMPoint(X,Y)) or (PatternDAT[TileID[Bits]+1].Walkable<>0) then
      begin
        Land[Y,X].Terrain  := TileID[Bits];
  