Pair-correlation function in two-dimensional lattice gases