EmperorFool
Deity
Minor addition: when clearing a Forest/Jungle from a tile with an improvement that requires it (Lumbermill and Forest Preserve), the following code in CvDLLWidgetData::parseActionHelp() adds a second message below the "Will remove the <feature>" one.
Edit: Fixed so that it won't show a double message for build actions that will both replace a previous improvement and remove a feature that the previous improvement requires.
Code:
if (pMissionPlot->getFeatureType() != NO_FEATURE)
{
if (GC.getBuildInfo(eBuild).isFeatureRemove(pMissionPlot->getFeatureType()))
{
iProduction = pMissionPlot->getFeatureProduction(eBuild, pHeadSelectedUnit->getTeam(), &pCity);
if (iProduction > 0)
{
szBuffer.append(NEWLINE);
szBuffer.append(gDLL->getText("TXT_KEY_ACTION_CHANGE_PRODUCTION", iProduction, pCity->getNameKey()));
}
szBuffer.append(NEWLINE);
szBuffer.append(gDLL->getText("TXT_KEY_ACTION_REMOVE_FEATURE", GC.getFeatureInfo(pMissionPlot->getFeatureType()).getTextKeyWide()));
// BUG - Unofficial Patch - start
if (eImprovement == NO_IMPROVEMENT && pMissionPlot->getImprovementType() != NO_IMPROVEMENT && GC.getImprovementInfo(pMissionPlot->getImprovementType()).getFeatureMakesValid(pMissionPlot->getFeatureType()))
{
szBuffer.append(NEWLINE);
szBuffer.append(gDLL->getText("TXT_KEY_ACTION_WILL_DESTROY_IMP", GC.getImprovementInfo(pMissionPlot->getImprovementType()).getTextKeyWide()));
}
// BUG - Unofficial Patch - end
}
}
Edit: Fixed so that it won't show a double message for build actions that will both replace a previous improvement and remove a feature that the previous improvement requires.
Edit - moved here from the BBAI forum where I posted it originally cuz I wasn't thinking about where I was posting it cuz I was busy and should pay more attention to thinking about where I'm posting things next time. *nods*
You left the vanilla "if (healRate(pPlot) <= 0)" condition in at the end, however this is completely redundant with the new check of healTurns(pPlot) returning MAX_INT or not since healTurns calls healRate itself, and uses the same condition as part of its return value. So your version will cause healRate, which is a relatively expensive function, to get called twice most of the time, when it never needs to be.