Compute a threshold for starting location quality at 80% of the best starting location.
For each civ, if it is below that threshold
__iCount = 0
__For each plot in the fat cross
____//If SorenRandNum test based on iCount
____If plot does not have a bonus resource, and isn't the center plot
______Add a forest if possible
______iCount++
____}
__}
__iWaterCount = 0
__for each plot in the fat cross
____iWaterCount++
____if isWater()
______check for water resources
____else
______check for land resources
____}
__bLandBias = (iWaterCount > MAX_NUM_TILES/2)
__Add resources to tiles that can support them, until value > the 80% threshold established earlier, or until (2*waterResources + 3*landResources) >= 12
}
The problems are, first, the If test based on iCount should not be commented out. With that test in place, forests will be added to a few tiles. With it commented out, forests are added to every single non-resource tile that can support a forest. This leads to the familiar "buried in forests" starts that we've come to loathe since BtS (at least I loathe them, since they force BW before you can build cottages/mines/etc). Plus there's the pernicious effect further down, that additional resources generally can't be added to forested tiles. So when the code tries to bring the starting position up to the 80% threshold, it either does it by spamming seafood or not at all. Note that iCount is not used anywhere else, so it's pretty clear that commenting out that line is indeed unintentional.
Second, and less seriously, iWaterCount++ belongs inside the isWater() test. As written, iWaterCount will always add up to MAX_NUM_TILES - 1, and bLandBias will always be true. bLandBias exists to encourage addition of land resources to water-heavy capitals.