Thalassicus
Bytes and Nibblers
I noticed this bug a few years ago. To reproduce the bug:
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:
line 1394 of UnitPanel.lua function TipHandler:
line 2450 of CvPlot.cpp function getFeatureProduction:
line 2541 of CvGlobals.cpp function getBuildInfo:
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.
- Update the Production field of the BUILD_REMOVE_FOREST row in the BuildFeatures table to a value other than 20.
- Start a game.


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.