Alright Dale, stomped another bug. Thanx to BlkBird to finding this one.
To recreate the bug in umodded Col2.
Start a game, open World Builder, create a City next to a forest, and give yourself a Wagon Train. Get some Lumber stored up and get a Dock or somthing built until it is just about done, make sure it requires only 4 Hammers to be finished. Take all the Lumber out of the City and put it in your Wagon Train. Take 3 Lumber out of the Wagon Train and put it back in the city. Put a none Expert Carpenter on the Carpenter's Shop.
You should now be producing 4 Hammers, your Dock requires 4 Hammers, and the Dock says it will be done next Turn. If you end your turn however, you will find that even though your 3 Lumber were used, you only got a single Hammer, and now your Dock will take another 3 Turns to finish.
Thankfully, this was very easy to fix. The problem is that the Yield is removed from the City's Storage before the Production is calculated.
To fix it, go into CvCity's doTurn() and move doProduction() above doYield().
Code:
void CvCity::doTurn()
{
PROFILE_FUNC();
CvPlot* pLoopPlot;
int iI;
if (!isBombarded())
{
changeDefenseDamage(-(GC.getDefineINT("CITY_DEFENSE_DAMAGE_HEAL_RATE")));
}
setLastDefenseDamage(getDefenseDamage());
setBombarded(false);
AI_doTurn();
bool bAllowNoProduction = !doCheckProduction();
doSpecialists();
// PatchMod: ? START
doProduction(bAllowNoProduction);
// PatchMod: ? END
doYields();
doGrowth();
doCulture();
doPlotCulture(false, getOwnerINLINE(), getCultureRate());
// PatchMod: ? START
//doProduction(bAllowNoProduction);
// PatchMod: ? END
doDecay();
doMissionaries();
doRebelSentiment();
We kill bugs dead.