anchor.diff:  procedure TKMTerrain.SaveToFile(const aFile: UnicodeString; const aInsetRect: TKMRect);
   var
     MapDataSize: Cardinal;
  +const
  +  H_RND_HALF = HEIGHT_RAND_VALUE div 2;
   
     //aDir - direction of enlarge for new generated tile
     procedure SetNewLand(var S: TKMemoryStreamBinary; aToX, aToY, aFromX, aFromY: Word;
  -                       aNewGenTileX, aNewGenTileY: Boolean; aDir: TKMDirection = dirNA);
  +                       aNewGenTile: Boolean; aDir: TKMDirection = dirNA);
     var
  -    L, D, adj: Integer;
  +    L, D, adj, hMid: Integer;
       TileBasic: TKMTerrainTileBasic;
       terKind: TKMTerrainKind;
       CornersTerKinds: TKMTerrainKindsArray;
     begin
       // new appended terrain
  -    if aNewGenTileX or aNewGenTileY then
  +    if aNewGenTile then
       begin
  +      //Check if terrainKind is same for all 4 corners
         if not TileTryGetTerKind(aFromX, aFromY, terKind) then
         begin
           CornersTerKinds := TileCornersTerKinds(aFromX, aFromY);
   
  -        if aDir = dirNA then
  +        if aDir = dirNA then // that should never happen usually
             terKind := tkGrass
           else
           begin
  
positive.code:           BaseLayer.Terrain := 0;
          LayersCnt    := 0;
          BaseLayer.Corners := [0,1,2,3];
          Height       := 30 + KaMRandom(7, 'TKMTerrain.MakeNewMap 3');  //variation in Height
          BaseLayer.Rotation     := KaMRandom(4, 'TKMTerrain.MakeNewMap 4');  //Make it random
          Obj          := OBJ_NONE;             //none
          IsCustom     := False;
  
negative.code:         end;
        end;
  
        //Apply some random tiles for artisticity
        TileBasic.BaseLayer.Terrain  := gGame.MapEditor.TerrainPainter.PickRandomTile(terKind, True);
        TileBasic.BaseLayer.Rotation := KaMRandom(4, 'TKMTerrain.SaveToFile.SetNewLand 2');
        TileBasic.BaseLayer.Corners := [0,1,2,3];
        //find height mid point to make random elevation even for close to 0 or 100 height
        hMid := Max(0, Land[aFromY,aFromX].Height - H_RND_HALF) + H_RND_HALF;
        hMid := Min(100, hMid + H_RND_HALF) - H_RND_HALF;
        TileBasic.Height    := EnsureRange(hMid - H_RND_HALF + KaMRandom(HEIGHT_RAND_VALUE, 'TKMTerrain.SaveToFile.SetNewLand 3'), 0, 100);
        TileBasic.Obj       := OBJ_NONE; // No object
        TileBasic.IsCustom  := False;
        TileBasic.BlendingLvl := DEFAULT_BLENDING_LVL;
        TileBasic.LayersCnt := 0;
      end
      else
  