anchor.diff:  
     TKMTerrainTileBrief = record
       X,Y: Byte;
  -    Terrain: Byte;
  -    Rotation: Byte;
  -    Height: Byte;
  -    Obj: Byte;
  -    ChangeSet: TKMTileChangeTypeSet;
  -  end;
  -
  -  TKMTerrainTileChangeError = packed record
  -    X, Y: Byte;
  -    ErrorsIn: TKMTileChangeTypeSet;
  -  end;
  -
  -  TKMTerrainTileChangeErrorArray = array of TKMTerrainTileChangeError;
  -
  +    Terrain: Byte;
  +    Rotation: Byte;
  +    Height: Byte;
  +    Obj: Byte;
  +    ChangeSet: TKMTileChangeTypeSet;
  +  end;
  +
  +  TKMTerrainTileChangeError = packed record
  +    X, Y: Byte;
  +    ErrorsIn: TKMTileChangeTypeSet;
  +  end;
  +
  +  TKMTerrainTileChangeErrorArray = array of TKMTerrainTileChangeError;
  +
     TKMTerrainTile = record
       Terrain: Byte;
       Height: Byte;
  
positive.code:       Inc(ErrCnt);
      end;
  
      if not Result and aRevertOnFail then
        Break;
    end;
  
    if not Result and aRevertOnFail then
    begin
      //Restore backup Land, when revert needed
      for I := 1 to fMapY do
        for J := 1 to fMapX do
          Land[I, J] := BackupLand[I-1][J-1];
      SetLength(BackupLand, 0); // Release dynamic array memory. This array can be huge, so we should clear it as fast as possible
    end
    else
    begin
      if not KMSameRect(HeightRect, KMRECT_INVALID_TILES) then
        gTerrain.UpdateLighting(KMRectGrow(HeightRect, 2)); // Update Light only when height was changed
  
      gTerrain.UpdatePassability(KMRectGrowTopLeft(Rect));
      gTerrain.UpdateWalkConnect([wcWalk, wcRoad, wcFish, wcWork], KMRectGrowTopLeft(Rect), DiagonalChangedTotal);
    end;
  
    //Cut errors array to actual size
    if Length(aErrors) <> ErrCnt then
      SetLength(aErrors, ErrCnt);
  end;
  
  
  
negative.code:   end;
  
  var I, J: Integer;
      T: TKMTerrainTileBrief;
      Rect, HeightRect: TKMRect;
      DiagonalChangedTotal, DiagChanged: Boolean;
      BackupLand: array of array of TKMTerrainTile;
  