Afforess
The White Wizard
I'm having trouble having the effects of one of my new CvBuildingInfos arrays show up. Despite having the code in CvGameTextMgr, it refuses to show up. My change, which is an array called PrereqNotBuildingClass checks to see that a city doesn't have the specified building before it can construct this one. If it does have the building, you can't build the building. For Instance, so you can't build in the Versailles in the same city as your palace. Anyway, that isn't the problem, my code works perfectly, except with CvGameTextMgr, can someone tell me what I did wrong?
My Code:
My Code:
Code:
void CvGameTextMgr::setBuildingHelpActual(CvWStringBuffer &szBuffer, BuildingTypes eBuilding, bool bCivilopediaText, bool bStrategyText, bool bTechChooserText, CvCity* pCity, bool bActual)
{
...
bFirst = true;
for (iI = 0; iI < GC.getNumBuildingClassInfos(); ++iI)
{
if (ePlayer != NO_PLAYER)
{
eLoopBuilding = ((BuildingTypes)(GC.getCivilizationInfo(GET_PLAYER(ePlayer).getCivilizationType()).getCivilizationBuildings(iI)));
}
else
{
eLoopBuilding = (BuildingTypes)GC.getBuildingClassInfo((BuildingClassTypes)iI).getDefaultBuildingIndex();
}
if (eLoopBuilding != NO_BUILDING)
{
if (GC.getBuildingInfo(eLoopBuilding).isPrereqNotBuildingClass(kBuilding.getBuildingClassType()))
{
if ((pCity == NULL) || !(pCity->canConstruct(eLoopBuilding)))
{
szFirstBuffer.Format(L"%s%s", NEWLINE, gDLL->getText("TXT_KEY_BUILDING_NOT_REQUIRED_TO_BUILD").c_str());
szTempBuffer.Format(SETCOLR L"<link=literal>%s</link>" ENDCOLR, TEXT_COLOR("COLOR_BUILDING_TEXT"), GC.getBuildingInfo(eLoopBuilding).getDescription());
setListHelp(szBuffer, szFirstBuffer, szTempBuffer, L", ", bFirst);
bFirst = false;
}
}
}
}
...
}