After looking through the building yield override code for something like the 3rd time, I think I figured out why it doesn't work correctly...
The current code (starting on line 994 of CvCity.cpp):
Code:
//Building yields
for (int iBuilding = 0; iBuilding < GC.getNumBuildingInfos(); iBuilding++)
{
BuildingTypes eBuilding = (BuildingTypes)iBuilding;
if (getNumRealBuilding(eBuilding) > 0)
{
iBuildingYield = GC.getBuildingInfo(eBuilding).getYieldChange(iYieldLoop) * getNumRealBuilding(eBuilding);
}
iYield += iBuildingYield;
}
Notice that inside the for loop the value of iBuildingYield is never zeroed.
If you have a building in the city that has a non-zero yield for the current yield type, then it sets iBuildingYield to that value (times the number of buildings of that type) and adds it to the iYield value on the iteration of the loop for that building. But the next time through the loop the value of iBuildingYield is still what it was on the previous time through the loop, so it gets added in to iYield again. And again. And again. Until it hits a building type that actually exists in the city, at which point the iBuildingYield value changes to what this new building type has for its yield value (times the number of them that there are in the city). Since most buildings have a 0 for this, it usually zeros out the iBuildingYield value and stops adding it in at that point.
This is why the Capitol building in FF+ does not have this problem: in each system there is also the planet in the system that gets the system's free Nutrition Facility, which just happens to be the 2nd building in CIV4BuildingInfos.xml which is right after the Palace (which is, of course, the first building in the file) and which therefore zeros out iBuildingYield since it has the default YieldChange of 0 commerce.
This explains the amount of commerce that the Office of the Auditor General usually provides as well. It is building number 49 and there are another 21 buildings in the file after that one so it adds it's 4 commerce for itself, then adds it for each of the 21 buildings after itself in the list for another 84 which gives a total of 88. This value decreases if any of the 21 buildings after it in the list is built (which are the various UBs, some World Wonders, and the 6 resource related buildings) since none of them produce 4 commerce per turn. Likewise for the various resource related buildings - they are the last ones in the file and only 2 of them provide any yield (ranch gives +1 production, harbor gives +1 commerce) - if you count the number of buildings after them in the file, this is the extra yield they are giving.
The reason various other mods switching to this is worse is presumably that they still have the Capitol building first in the file and it probably still provides something like 8 commerce per turn. But they are evidently not giving one of the very next building in the file to the system for free. If there are no free buildings at all then it should be giving an amount of commerce equal to the commerce yield given by the Capitol times the number of buildings in the file. If there are free buildings, then it would be less (assuming that the free building doesn't give the same amount of commerce) and the amount less would depend on where in the list the free building is located.
The simplest fix would be to get rid of the iBuildingYield variable and just add directly to iYield instead. The other good option is to zero iBuildingYield inside the loop before the "if" statement. There are other more complicated (and slower) ways to do it, but I would just use one of these (probably the first).