Chop Forest bug

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
I noticed this bug a few years ago. To reproduce the bug:
  1. Update the Production field of the BUILD_REMOVE_FOREST row in the BuildFeatures table to a value other than 20.
  2. Start a game.

featureproduction.jpg


featureproduction2.jpg


Tooltips for building a farm/mine/etc on a forest always show 20 production, regardless of what the build provides. Building the improvement always provides the correct production. This seemed like a simple interface error I could solve. However, when I investigated I found both tooltips appear to use the same block of code in UnitPanel.lua. I tracked the bug this far:

line 995 of CIV5GameTextInfos_WorldView.xml:
Code:
<Text>The {1_FeatureName:textkey} on this tile will be removed</Text>

line 1394 of UnitPanel.lua function TipHandler:
Code:
local iFeatureProduction = pPlot:GetFeatureProduction(iBuildID, iActiveTeam);

line 2450 of CvPlot.cpp function getFeatureProduction:
Code:
iProduction = GC.getBuildInfo(eBuild)->getFeatureProduction(getFeatureType());

line 2541 of CvGlobals.cpp function getBuildInfo:
Code:
return m_paBuildInfo[eBuildNum];

I looked around the code at each of these steps, but was unable to identify what's causing the problem. The TipHandler function in UnitPanel.lua is the most complicated, so it seems the most likely culprit, though I don't know for sure.
 
Possibly related issue, the rollover for chopping a forest with a camp on it will display a change in yield as if the camp would also be removed.
 
I think in some early version of civ a camp actually got removed when the forest was chopped... they really could take that warning out by now as well.

Probably related bugs:
-Building anything during a golden Age displaying the golden age bonus (more importantly, that ga bonus gold influences on the AI/automatic worker decision making).
-Gold production bonus displayed on Great Citadel when used on a river tile.
 
Back
Top Bottom