Hi all,
So I am using one of Kael's modcomps, Assimilation.
There is a bug in the component, since when I conquer a city I am still able to build my unique building in it, even though it already has the normal version of the same building. Playing e.g. Romans, this allows me to build the Forum in conquered cities that already have a marketplace, and I thus get the benefit of both buildings.
I am trying to figure out how to fix this, as Kael doesn't seem to have time to look into this. What I'd like to do in this specific situation is to disallow my own unique building in the conquered city, although I am open to other (easier) solutions. I *think* I need to add a condition in the pasted code below (like: if the city has foo building, disallow the unique foo building), but I don't know how to syntax it properly. Help!
This is from CvCity.cpp:
And from CvPlayer.cpp
So I am using one of Kael's modcomps, Assimilation.
There is a bug in the component, since when I conquer a city I am still able to build my unique building in it, even though it already has the normal version of the same building. Playing e.g. Romans, this allows me to build the Forum in conquered cities that already have a marketplace, and I thus get the benefit of both buildings.
I am trying to figure out how to fix this, as Kael doesn't seem to have time to look into this. What I'd like to do in this specific situation is to disallow my own unique building in the conquered city, although I am open to other (easier) solutions. I *think* I need to add a condition in the pasted code below (like: if the city has foo building, disallow the unique foo building), but I don't know how to syntax it properly. Help!
This is from CvCity.cpp:
Code:
bool CvCity::canConstruct(BuildingTypes eBuilding, bool bContinue, bool bTestVisible, bool bIgnoreCost) const
[...]
//Ass: Added by Kael 07/02/2008
if (GC.getGameINLINE().isOption(GAMEOPTION_ASSIMILATION))
{
BuildingClassTypes eBuildingClass = ((BuildingClassTypes)(GC.getBuildingInfo(eBuilding).getBuildingClassType()));
if (GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(eBuildingClass) != eBuilding)
{
return false;
}
}
//Ass: End Add
And from CvPlayer.cpp
Code:
bool CvPlayer::canConstruct(BuildingTypes eBuilding, bool bContinue, bool bTestVisible, bool bIgnoreCost) const
[...]
//Ass: Modified by Kael 07/02/2008
// FAssert(GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(eBuildingClass) == eBuilding);
// if (GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(eBuildingClass) != eBuilding)
// {
// return false;
// }
if (!GC.getGameINLINE().isOption(GAMEOPTION_ASSIMILATION))
{
FAssert(GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(eBuildingClass) == eBuilding);
if (GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(eBuildingClass) != eBuilding)
{
return false;
}
}
//Ass: End Modify